Notifications
Clear all

Arduino based function to control stepper motors

43 Posts
6 Users
3 Likes
2,056 Views
Ron
 Ron
(@zander)
Member
Joined: 3 years ago
Posts: 5948
 

@kirk @Inq is perfectly capable of answering your question but I don't see him online so I will take the easy one.

const_float is not a valid keyword. const is and float is, they mean constant (can't be modified by program code) and float means a floating point number. Those are numbers with . in them generally like 3.14. 

Flat 4 strand cable as you call it is available from all the usual places, Amazon for speedy delivery but highest price, AliExpress for long delivery but cheap, e-bay or bang good in betweeen the other two plus any one of numerous electronics supply houses, just google it.

Arduino says and I agree, in general, the const keyword is preferred for defining constants and should be used instead of #define
"Never wrestle with a pig....the pig loves it and you end up covered in mud..." anon
My experience hours are >75,000 and I stopped counting in 2004.
Major Languages - 360 Macro Assembler, Intel Assembler, PLI/1, Pascal, C plus numerous job control and scripting


   
Inq reacted
ReplyQuote
Ron
 Ron
(@zander)
Member
Joined: 3 years ago
Posts: 5948
 

@kirk Is this what you are looking for?

https://amz.run/5sKd "https://amz.run/5sKd"

NOTE, Canadian site, change it to .com if in the USA.

 

Arduino says and I agree, in general, the const keyword is preferred for defining constants and should be used instead of #define
"Never wrestle with a pig....the pig loves it and you end up covered in mud..." anon
My experience hours are >75,000 and I stopped counting in 2004.
Major Languages - 360 Macro Assembler, Intel Assembler, PLI/1, Pascal, C plus numerous job control and scripting


   
ReplyQuote
Ron
 Ron
(@zander)
Member
Joined: 3 years ago
Posts: 5948
 

@kirk @Inq FYI Try testing with @Inq's amended sketch. We know it works, if yours does not then you have hardware problems. Change each piece of hardware while running the known working sketch until you find the problem. Now you can try to move forward.

Arduino says and I agree, in general, the const keyword is preferred for defining constants and should be used instead of #define
"Never wrestle with a pig....the pig loves it and you end up covered in mud..." anon
My experience hours are >75,000 and I stopped counting in 2004.
Major Languages - 360 Macro Assembler, Intel Assembler, PLI/1, Pascal, C plus numerous job control and scripting


   
ReplyQuote
 Kirk
(@kirk)
Member
Joined: 2 years ago
Posts: 23
Topic starter  

@zander 

Thanks Ron. I will compare sites and see what looks good.


   
ReplyQuote
 Kirk
(@kirk)
Member
Joined: 2 years ago
Posts: 23
Topic starter  

@zander     I appreciate the good advice. I will update you on progress.


   
ReplyQuote
 Kirk
(@kirk)
Member
Joined: 2 years ago
Posts: 23
Topic starter  

@robotbuilder 

Hi,  The code is designed to turn the motor-that was the plan anyway.


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 2 years ago
Posts: 2488
 
Posted by: @kirk

Do you know a good source for flat  4 strand cable?  I want to connect straight from the Arduino digital output port to the driver.

see Amazon

"https://www.amazon.ca/C-able-Extension-Extend-Solderless-Connector/dp/B07FDW4M89/ref=sr_1_6?crid=1NO0M35HLML8G&keywords=extension+wire+led&qid=1661134899&sprefix=extension+wire+led%2Caps%2C294&sr=8-6"

I had a psychic girlfriend but she left me before we met.


   
ReplyQuote
 Kirk
(@kirk)
Member
Joined: 2 years ago
Posts: 23
Topic starter  

@zander   For anyone interested I found a source for cables with Arduino terminals on EBAY.  I pasted the link below.

https://www.ebay.com/itm/124825421876

 


   
ReplyQuote
Ron
 Ron
(@zander)
Member
Joined: 3 years ago
Posts: 5948
 

@kirk I am not sure what you bought, but the price is high and it does not appear to be a complete set.

The set I bought is 360 pieces total, for $11.55

3 x 40 Male to Female

3 x 40 Male to Male

3 x 40 Female to Female

Arduino says and I agree, in general, the const keyword is preferred for defining constants and should be used instead of #define
"Never wrestle with a pig....the pig loves it and you end up covered in mud..." anon
My experience hours are >75,000 and I stopped counting in 2004.
Major Languages - 360 Macro Assembler, Intel Assembler, PLI/1, Pascal, C plus numerous job control and scripting


   
ReplyQuote
Ron
 Ron
(@zander)
Member
Joined: 3 years ago
Posts: 5948
 

@kirk What is an Arduino terminal?

Arduino says and I agree, in general, the const keyword is preferred for defining constants and should be used instead of #define
"Never wrestle with a pig....the pig loves it and you end up covered in mud..." anon
My experience hours are >75,000 and I stopped counting in 2004.
Major Languages - 360 Macro Assembler, Intel Assembler, PLI/1, Pascal, C plus numerous job control and scripting


   
ReplyQuote
 Kirk
(@kirk)
Member
Joined: 2 years ago
Posts: 23
Topic starter  

@zander    Re: Arduino cables. What I intended to be ordering was two male/female cables 4 strand x 50 cm. They are on their way. You may be right I don't order from EBAY a lot; so I didn't know if that was a good price. I don't really need that length at the moment; but I will need to set up for outdoor testing.


   
ReplyQuote
Ron
 Ron
(@zander)
Member
Joined: 3 years ago
Posts: 5948
 

@kirk This is a complete set, Male to Male, Female to Female, and Male to Female. 40 wires per bunch, 3 bunches per type. Ends are male and female dupont connectors. I have never heard of Arduino terminals.

https://amz.run/5sir "https://amz.run/5sir"

Arduino says and I agree, in general, the const keyword is preferred for defining constants and should be used instead of #define
"Never wrestle with a pig....the pig loves it and you end up covered in mud..." anon
My experience hours are >75,000 and I stopped counting in 2004.
Major Languages - 360 Macro Assembler, Intel Assembler, PLI/1, Pascal, C plus numerous job control and scripting


   
ReplyQuote
 Kirk
(@kirk)
Member
Joined: 2 years ago
Posts: 23
Topic starter  

@zander   @Inq

      Hi Ron,   I located the problem, aka my mistake.  I had switched between a couple of different types of driver boards and assumed the Vcc and Ground were in a certain location. I attached a photo. As you know there are different styles of board that differ somewhat on Vc placement.  In the future I'm always going to check continuity between pin 16 of the Darlington chip and the output pins as well as documentation if I can find any.  Any suggestions?

Thanks again for your help. I will provide follow-up as my crazy project proceeds.  Kirk

M3 Driver

 


   
DaveE reacted
ReplyQuote
Page 3 / 3