By continuing to use this site, you agree to our use of cookies. Find out more

Member postings for Malc

Here is a list of all the postings Malc has made in our forums. Click on a thread name to jump to the thread.

Thread: Arduino programming?
26/11/2020 20:23:42

Thanks Duncan, that looks like a quest for tomorrow.

26/11/2020 18:27:46

Hi Duncan, the display I am using is a 4x7 segment common cathode type (Proto-pic part No. COM-10145). The Arduino pins 10,11, 12, 13 are connected to the D1, D2, D3, D4 cathodes of the 4 digits. The remaining 8 segments are connected to the Arduino pins 2, 3, 4, 5, 6, 7, 8 & 9. All 4 segments do light up at once in the sequence 0000, 1111, 2222, 3333........etc. and then continually repeat. This is exactly what I wanted but in the interests of learning more about programming I am trying to improve the sketch

26/11/2020 17:30:58

code part 2

delay(Don); // wait for a second

digitalWrite(2,LOW); //turn the following LEDs (segments)off.
digitalWrite(4, LOW);
digitalWrite(5, LOW);
digitalWrite(7, LOW);
digitalWrite(8, LOW);
digitalWrite(9, LOW);

//delay(Doff); // wait for a second

digitalWrite(2, HIGH); // turn the following LEDs (segments) on to display the number 6.
digitalWrite(4, HIGH);
digitalWrite(5, HIGH);
digitalWrite(6, HIGH);
digitalWrite(7, HIGH);
digitalWrite(8, HIGH);
digitalWrite(9, HIGH);

delay(Don); // wait for a second

digitalWrite(2, LOW); //turn the following LEDs (segments)off.
digitalWrite(4, LOW);
digitalWrite(5, LOW);
digitalWrite(6, LOW);
digitalWrite(7, LOW);
digitalWrite(8, LOW);
digitalWrite(9, LOW);

//delay(Doff); // wait for a second

digitalWrite(2, HIGH); // turn the following LEDs (segments) on to display the number 7.
digitalWrite(3, HIGH);
digitalWrite(4, HIGH);
digitalWrite(9, HIGH);

delay(Don); // wait for a second

digitalWrite(2, LOW); //turn the following LEDs (segments)off.
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(9, LOW);

//delay(Doff); // wait for a second

digitalWrite(2, HIGH); // turn the following LEDs (segments) on to display the number 8.
digitalWrite(3, HIGH);
digitalWrite(4, HIGH);
digitalWrite(5, HIGH);
digitalWrite(6, HIGH);
digitalWrite(7, HIGH);
digitalWrite(8, HIGH);
digitalWrite(9, HIGH);

delay(Don); // wait for a second

digitalWrite(2, LOW); //turn the following LEDs (segments)off.
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
digitalWrite(6, LOW);
digitalWrite(7, LOW);
digitalWrite(8, LOW);
digitalWrite(9, LOW);

//delay(Doff); // wait for a second

digitalWrite(2, HIGH); // turn the following LEDs (segments) on to display the number 9.
digitalWrite(3, HIGH);
digitalWrite(4, HIGH);
digitalWrite(5, HIGH);
digitalWrite(7, HIGH);
digitalWrite(8, HIGH);
digitalWrite(9, HIGH);

delay(Don); // wait for a second

digitalWrite(2, LOW); //turn the following LEDs (segments)off.
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
digitalWrite(7, LOW);
digitalWrite(8, LOW);
digitalWrite(9, LOW);

//delay(Doff); // wait for a second

}

26/11/2020 17:29:27

Code part 1

// tests a 4x7 seg. disp. with modified blink sketch. displays 0000 1111 2222 3333 etc. with decimal points after all digits.

#define seg //output pins to 7 segment display
#define Don 1000 //delay setting the ON time of segments
#define Doff 250 //delay setting the OFF time of segments


void setup() {
// put your setup code here, to run once:
pinMode(2, OUTPUT); // A segment of display
pinMode(3, OUTPUT); // B segment of display
pinMode(4, OUTPUT); // C segment of display
pinMode(5, OUTPUT); // D segment of display
pinMode(6, OUTPUT); // E segment of display
pinMode(7, OUTPUT); // F segment of display
pinMode(8, OUTPUT); // G segment of display
pinMode(9, OUTPUT); // Decimal Point segment of display
pinMode(10, OUTPUT); // D1 cathode of display
pinMode(11, OUTPUT); // D2 cathode of display
pinMode(12, OUTPUT); // D3 cathode of display
pinMode(13, OUTPUT); // D4 cathode of display
}

void loop()

{

digitalWrite(2, HIGH); // turn the following LEDs (segments) on to display the number 0.
digitalWrite(3, HIGH);
digitalWrite(4, HIGH);
digitalWrite(5, HIGH);
digitalWrite(6, HIGH);
digitalWrite(7, HIGH);
digitalWrite(9, HIGH);

delay(Don); // wait for a second.

digitalWrite(2, LOW); //turn the following LEDs (segments)off.
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
digitalWrite(6, LOW);
digitalWrite(7, LOW);
digitalWrite(9, LOW);

//delay(Doff); // wait for a second.

digitalWrite(3, HIGH); // turn the following LEDs (segnments)on to display the number 1.
digitalWrite(4, HIGH);
digitalWrite(9, HIGH);

delay(Don); // wait for a second

digitalWrite(3, LOW); //turn the following LEDs (segments)off.
digitalWrite(4, LOW);
digitalWrite(9, LOW);

// delay(Doff); // wait for a second

digitalWrite(2, HIGH); // turn the following LEDs (segnments)on to display the number 2.
digitalWrite(3, HIGH);
digitalWrite(5, HIGH);
digitalWrite(6, HIGH);
digitalWrite(8, HIGH);
digitalWrite(9, HIGH);

delay(Don); // wait for a second

digitalWrite(2, LOW); //turn the following LEDs (segments)off.
digitalWrite(3, LOW);
digitalWrite(5, LOW);
digitalWrite(6, LOW);
digitalWrite(8, LOW);
digitalWrite(9, LOW);

//delay(Doff); // wait for a second

digitalWrite(2, HIGH); // turn the following LEDs (segnments)on to display the number 3.
digitalWrite(3, HIGH);
digitalWrite(4, HIGH);
digitalWrite(5, HIGH);
digitalWrite(8, HIGH);
digitalWrite(9, HIGH);

delay(Don); // wait for a second

digitalWrite(2,LOW); //turn the following LEDs (segments)off.
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
digitalWrite(8, LOW);
digitalWrite(9, LOW);

//delay(Doff); // wait for a second

digitalWrite(3, HIGH); // turn the following LEDs (segnments)on to display the number 4.
digitalWrite(4, HIGH);
digitalWrite(7, HIGH);
digitalWrite(8, HIGH);
digitalWrite(9, HIGH);

delay(Don); // wait for a second

digitalWrite(3,LOW); //turn the following LEDs (segments)off.
digitalWrite(4, LOW);
digitalWrite(7, LOW);
digitalWrite(8, LOW);
digitalWrite(9, LOW);

// delay(Doff); // wait for a second

digitalWrite(2, HIGH); // turn the following LEDs (segnments)on to display the number 5.
digitalWrite(4, HIGH);
digitalWrite(5, HIGH);
digitalWrite(7, HIGH);
digitalWrite(8, HIGH);
digitalWrite(9, HIGH);

delay(Don); // wait for a second

26/11/2020 17:26:32

Since my last post on this subject I have had some success with the programming. I have now got the sketch to light all the 4x7 segments in turn and their decimal points. The only trouble is that the sketch is over 200 lines long and I'm sure that there must be a better way of doing this. I have been trying to use arrays to group the "digital write" lines into 0, 1, 2, etc arrays to replace these lines and so shorten the sketch. Am I on the right lines? I will try to post he code here. I think the Arduino forum have grown a little impatient with me so I would be grateful for any suggestions. NB. It seems the post is too long so I will post the sketch in another post.

24/11/2020 17:17:28

I have successfully used LCD displays in the past, but wanted a larger 7 segment display for the clock project. It’s the failing eyesight you know!

23/11/2020 12:15:38

Actually Roger it is a display that started this recent flurry of programming. I had made a project using a larger 4x7 segment display and an off shoot of that was finding a sketch online for testing these displays. It didnt use a shift register and looked quite simple. To cut a long story short it worked except that it did not light up the decimal points of the display. Several of the Arduino forum fellas queried the library and I tried installing different ones and many other dodges but no luck. The opinion on the forum was that I would be better scrapping the sketch and starting afresh taking small steps and testing them out as I went - much along the lines many of you chaps have suggested. So that is what I am doing at the moment. Thanks again to all for your inputs, much appreciated!

22/11/2020 22:05:54

Andy, have just had a quick look a that, very interesting, certainly worth a look. Many thanks to all for the suggestions advice etc.

22/11/2020 21:03:27

Duncan, thanks for that, I will look into that book, sounds interesting.

Martin, I did actually get an introductory book on programming C but found it too deep for me.

22/11/2020 19:31:59

Hi Bazyle, that’s the path I am on at the moment, though less complicated than your example. Good to know I’m going in the right direction at least.

22/11/2020 18:43:12

I have had some help on the coding forums but I have also had a few rebukes for not being a genius! Certainly don’t feel as “at home” as I do on here. Thanks for the replies, makes me feel less thick if nothing else.

22/11/2020 17:10:50

For some time now I have been tinkering with the Arduino and have made a couple useable items. However, the stumbling block is always the programming. Up to now I have used sketches found on line or in books etc., but If I want to depart from the copied sketch I come unstuck! I have bought a couple of books which have helped but my poor old brain just doesn't seem to handle Arduino code. I know some of you fellows use the Arduino so I wondered whether you had a recommended system of learning the coding, perhaps you have a background in computer programming in a past life? Is it that difficult to master, or am I just a bit thick??

Thread: Another scam
09/11/2020 17:45:23

Thought it was just me, I have had loads of these “Your name has been selected in our prize draw” or similar. The recent one insists that my subscription to Norton antivirus is about to expire, strange, as I do not have a Norton subscription. I have got to the stage that if I don’t know the sender I just delete them

Thread: ML7 cross-slide and compound slide bearing upgrades
24/10/2020 09:31:13

I did this mod to both cross slide and top side. I posted about this in December 2017, if you check my posts it will explain how I did it. All the best.

Malc.

Thread: New shaft in Oilite bushes?
02/09/2020 10:58:23

Hi David, I’m still playing around with the drive belt / pulleys to try and improve that side of the job first. I did look at the cost of the bushes and silver steel myself, not too bad. Thanks for that.

01/09/2020 20:38:46

Yes, that’s how I’ve done it in the past, just a nuisance. Nice to know I’m doing things right though.

01/09/2020 20:08:04

Hi David, the shaft is about 4” long and 3/4” outside diameter. The bushes in the casting are 7/8” outside diameter.

01/09/2020 19:02:55

Thanks for the heads up about the oilite bushes fellas. Not being a “Proper” engineer these are the sort of things that make me nervous when it comes to fitting bushes to castings. The difficulty in accurately measuring an inside diameter doesn’t help in these cases.

01/09/2020 09:12:52

Morning all. Thanks for the interest, very much appreciated.

Ian, I had considered turning down the shaft but I think it is too hard, I certainly can’t make any impression on it with a file.

David, your silver steel idea is a thought. I will have to look into the cost of the bushes and silver steel etc.

Before going too far I would like to sort out the drive belt problems they all seem to have, apparently some on this forum have used PolyV belting. I suppose I am wondering whether the money spent will be worth it. Thanks again all for the replies.

31/08/2020 21:25:59

I am looking into replacing the worn bushes in a Kennedy hacksaw with oilite bushes, however the shaft is also worn and I would like to make a new shaft. The question is, could I make the new shaft out of mild steel or would it need to be made from something special? I am also wondering how good the finish would need to be when making the new shaft on the lathe?

Magazine Locator

Want the latest issue of Model Engineer or Model Engineers' Workshop? Use our magazine locator links to find your nearest stockist!

Find Model Engineer & Model Engineers' Workshop

Sign up to our Newsletter

Sign up to our newsletter and get a free digital issue.

You can unsubscribe at anytime. View our privacy policy at www.mortons.co.uk/privacy

Latest Forum Posts
Support Our Partners
cowells
Sarik
MERIDIENNE EXHIBITIONS LTD
Subscription Offer

Latest "For Sale" Ads
Latest "Wanted" Ads
Get In Touch!

Do you want to contact the Model Engineer and Model Engineers' Workshop team?

You can contact us by phone, mail or email about the magazines including becoming a contributor, submitting reader's letters or making queries about articles. You can also get in touch about this website, advertising or other general issues.

Click THIS LINK for full contact details.

For subscription issues please see THIS LINK.

Digital Back Issues

Social Media online

'Like' us on Facebook
Follow us on Facebook

Follow us on Twitter
 Twitter Logo

Pin us on Pinterest

 

Donate

donate