Notifications
Clear all

Arduino with Stepper and LiquidCrystal Issue

308 Posts
5 Users
12 Likes
22.5 K Views
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2504
 

@voltage

In my opinion, helping other people solve problems, learn and achieve their objectives is what this forum is all about. Some matters are easier than others 🙂

The Arduino IDE uses C++ for classes or objects like stepper motors, LCDs, temp & humidity sensors and so on (usually in the form of a library). C++ is a superset of C, so that you can write C code anywhere.

For example, the AccelStepper library contains code to declare, construct and manage an object embodying  a range of stepper motor or stepper drivers. In your case, you create an instance of an AccelStepper object named stepper by giving its constructor the type of interface (driver) and the two relevant pins for that type (step and direction). The actual code in the class is all C.

The subroutine recalcSpeed is written in C but, as you see, is perfectly compatible, being used from inside the C++ method loop().

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2504
 
Posted by: @voltage

@will @madmisma

Are there any really good Arduino books out there. It would be nice to be able to download the Arduino Reference from the site but it seems to be online only.

 

This will be my next project. 😋 

I don't know about any good books. I was a programmer in a previous life and just needed to learn the electronics part.

So I chose a topic (LEDs, switches, buttons, sensors and so on) Googled for Arduino and that topic, picked an interesting looking video or URL, built it and played with it until I thought I understood how to make it work (or, occasionally how to blow it up - I have a tendency to create shorts in my sloppy wiring).

After the preliminaries, I picked a class of machines (plotters) and started trying to make as many different types as I could. I'd used them in my past but didn't know how they worked (either electronically or physically)

I have a 3D printer as well, so I could fabricate parts that I'd never have been able to make otherwise (I have hand tools and no shop).

I also learned that you rarely learn anything by doing it right the first time. It's only when the project goes FUBAR that you really have to dig in and figure out what's happening (or not) and THAT'S when you learn.

Your next project looks interesting, next you'll be ordering customized PCBs 🙂

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2504
 
Posted by: @voltage

@will @madmisma

Whoops, just noticed a typo. I think you meant madmisHa, not madmisMa.

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
(@voltage)
Member
Joined: 3 years ago
Posts: 187
Topic starter  
Posted by: @will

@voltage

In my opinion, helping other people solve problems, learn and achieve their objectives is what this forum is all about. Some matters are easier than others 🙂

The Arduino IDE uses C++ for classes or objects like stepper motors, LCDs, temp & humidity sensors and so on (usually in the form of a library). C++ is a superset of C, so that you can write C code anywhere.

For example, the AccelStepper library contains code to declare, construct and manage an object embodying  a range of stepper motor or stepper drivers. In your case, you create an instance of an AccelStepper object named stepper by giving its constructor the type of interface (driver) and the two relevant pins for that type (step and direction). The actual code in the class is all C.

The subroutine recalcSpeed is written in C but, as you see, is perfectly compatible, being used from inside the C++ method loop().

Will, you are a good person. 😎 Like when I started coding in VB6 I had some ( a lot) of things that didn't always make sense or were hard to understand. And I read a lot of really thick books on it. Then some day while walking in the woods with my dog and thinking, I would say to myself, "now I know what they meant" when it finally clicked. Had many of those moments when trying to learn too much, too fast. In the end it works out if you just keep trying. A lot of times it is just getting past the words or names of things that you don't understand. Kind of like Linux, the weird words they use that make no immediate sense just scare you from wanted to use them. LOL. It's all good.

 

edit I will fix the typo. Thanks!

 

Thanks,
Voltage


   
ReplyQuote
(@voltage)
Member
Joined: 3 years ago
Posts: 187
Topic starter  
Posted by: @will
Posted by: @voltage

@will @madmisma

Are there any really good Arduino books out there. It would be nice to be able to download the Arduino Reference from the site but it seems to be online only.

 

This will be my next project. 😋 

I don't know about any good books. I was a programmer in a previous life and just needed to learn the electronics part.

So I chose a topic (LEDs, switches, buttons, sensors and so on) Googled for Arduino and that topic, picked an interesting looking video or URL, built it and played with it until I thought I understood how to make it work (or, occasionally how to blow it up - I have a tendency to create shorts in my sloppy wiring).

After the preliminaries, I picked a class of machines (plotters) and started trying to make as many different types as I could. I'd used them in my past but didn't know how they worked (either electronically or physically)

I have a 3D printer as well, so I could fabricate parts that I'd never have been able to make otherwise (I have hand tools and no shop).

I also learned that you rarely learn anything by doing it right the first time. It's only when the project goes FUBAR that you really have to dig in and figure out what's happening (or not) and THAT'S when you learn.

Your next project looks interesting, next you'll be ordering customized PCBs 🙂

Ok on the books. I like watching youtube videos and reading blogs etc. Funny you mention LED's as I had started a project that used IR LED's and then I made my own PCB's and bought the high speed mini hobby drill and the carbide bits to drill the holes. Modified a laminator to press the design to the copper clad boards. I was having fum but it was so slow and time consuming. I ended up getting some boards made for my project which ended up on the back burner for now. It was a super simple design mainly just to make things look professional and a place to solder wires to for neatness. I wanted to make my own electronic flasher relay for motorcycles and wasted a lot of time trying but never finished. I too have more than one 3D Printer (Creality CR10S) and a Prusa I3 MK3S Kit to assemble some day. Bought the kit but it wasn't going to ship for a few months so I got the CR10S to use and learn. Lots of fun but again so slow...

latest 3
latest 2

 

Thanks,
Voltage


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2504
 

@voltage

Cool, I also have a CR10S and three Cetus printers. I wouldn't buy another Cetus now as it's over US$ 50 just for a nozzle.

I've had JLCPCB make a number of custom PCBs for my plotters and also for knitting counters for friends.

What stumped you on the electronic flasher relay for motorcycles ?

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
(@voltage)
Member
Joined: 3 years ago
Posts: 187
Topic starter  
Posted by: @will

@voltage

Cool, I also have a CR10S and three Cetus printers. I wouldn't buy another Cetus now as it's over US$ 50 just for a nozzle.

I've had JLCPCB make a number of custom PCBs for my plotters and also for knitting counters for friends.

What stumped you on the electronic flasher relay for motorcycles ?

I use JLCPCB too. On the relay, it was mainly I didn't know as much as I do now. 🙂 The thing that got me back when I was working on it was the varying voltage from the regulator would cause the rate of the flasher to vary based on rpms. Also, I was using a relay from ebay to go into the pcb and at that time I didn't have the skills to make a pcb. I was a complete noob.

 

added: What is a knitting counter?

 

Thanks,
Voltage


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2504
 

@voltage

I assume the regulator was the bike's regulator and there was no on-board regulator for the flasher.

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
(@voltage)
Member
Joined: 3 years ago
Posts: 187
Topic starter  
Posted by: @will

@voltage

I assume the regulator was the bike's regulator and there was no on-board regulator for the flasher.

Yes. And I knew/know about voltage regulators but also knew about added heat and then space for a heat sink etc. I took apart (many) 12V relays to study the inner workings but that just made things harder to figure out. The reason I started trying to figure it out was likely due to either a defective replacement relay that would flash at a high rate of speed, but an old style thermal activated relay worked. In the end the LED lights for the turn signals played a role as they offered less resistance etc...

 

Thanks,
Voltage


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2504
 

@voltage

My girlfriend and some other friends knit.

While knitting they have to keep track of how many rows they've done (to achieve the right length of body or sleeve or scarf or whatever). So, they use various kinds of clicky devices to count each row so they know when they're finished.

Also, if they're doing a lace pattern, they need to know which row of the pattern they're on so they'll know which sequence of stitches to do.

I made a very small device with 4 buttons to enable them to keep up to 4 projects on the go or two projects with row and lace lines or however they needed to use the 4 registers. It runs from USB on a power bank or laptop or computer or wall wart (depending on whether you're at home or in an airplane). It uses an extra memory chip to store values as the count changes. There are other embellishments too but you're probably saturated now and sorry you even asked 🙂

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2504
 
Posted by: @voltage

Yes. And I knew/know about voltage regulators but also knew about added heat and then space for a heat sink etc.

I wonder if a buck-boost converter would have fixed the problem ?

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
(@voltage)
Member
Joined: 3 years ago
Posts: 187
Topic starter  
Posted by: @will

@voltage

My girlfriend and some other friends knit.

While knitting they have to keep track of how many rows they've done (to achieve the right length of body or sleeve or scarf or whatever). So, they use various kinds of clicky devices to count each row so they know when they're finished.

Also, if they're doing a lace pattern, they need to know which row of the pattern they're on so they'll know which sequence of stitches to do.

I made a very small device with 4 buttons to enable them to keep up to 4 projects on the go or two projects with row and lace lines or however they needed to use the 4 registers. It runs from USB on a power bank or laptop or computer or wall wart (depending on whether you're at home or in an airplane). It uses an extra memory chip to store values as the count changes. There are other embellishments too but you're probably saturated now and sorry you even asked 🙂

I understand somewhat what you mean. Does it basically count and store/displays numbers with a digital display where one at a time of the up to 4 projects can de displayed at one time?

 

Thanks,
Voltage


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2504
 

@voltage

Yes, the 4 counters have an identifier (A,B,C,D) to help identify which count is which.

I'm using a 7 segment display with 4 digits (the case has to be very small so it can fit in a pocket for transport). You switch to the desired count with the buttons and inc/dec the count with buttons.

Only one identifier and count is displayed at a time.

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
(@voltage)
Member
Joined: 3 years ago
Posts: 187
Topic starter  
Posted by: @will
Posted by: @voltage

Yes. And I knew/know about voltage regulators but also knew about added heat and then space for a heat sink etc.

I wonder if a buck-boost converter would have fixed the problem ?

Possibly, and I have bought some of those from ebay but haven't messed with them yet. I would have to find them. 🙂 I need to cleaned out my garage so I can properly set up an electronics/3D Printer bench etc. The single car garage was converted to part of the house by removing the big door and putting up a wall and a window. But now it is full of previous soap making business fragrances and oils and just stuffed with stuff. But it has air conditioning and that stuff will go bad if I move it out to the big un-air conditioned shop because of the Florida heat. I am a pack rat so I have tons of stuff but nowhere to organize it. The living room is full of boxes etc... If I win the lottery I could add a/c to the big work shop or maybe partition it and add a/c to part of it. My next plan may be to build a small steel building behind the house but maybe 10 feet from it. Low ceiling height and a/c. Real world problems. LOL

 

Thanks,
Voltage


   
ReplyQuote
(@voltage)
Member
Joined: 3 years ago
Posts: 187
Topic starter  
Posted by: @will

@voltage

Yes, the 4 counters have an identifier (A,B,C,D) to help identify which count is which.

I'm using a 7 segment display with 4 digits (the case has to be very small so it can fit in a pocket for transport). You switch to the desired count with the buttons and inc/dec the count with buttons.

Only one identifier and count is displayed at a time.

Sounds like a good idea. I have all of the Forest Mimm's (think Radio Shack) electronic booklets from years ago and remember not understanding a lot of the ic's that are available that the booklets discussed. Like inverters and hex this or that. What ic do you use to make it work?

 

Thanks,
Voltage


   
ReplyQuote
Page 20 / 21