Help with Arduino code - Printable Version +- MetalworkingFun Forum (http://www.metalworkingfun.com) +-- Forum: Machining (http://www.metalworkingfun.com/forum-5.html) +--- Forum: CNC (http://www.metalworkingfun.com/forum-28.html) +--- Thread: Help with Arduino code (/thread-2617.html) |
RE: Help with Arduino code - chucketn - 04-05-2015 Me too! Tempted to fix an adult bev and chill. It might be actually easier to try to add the keypad to Chuck F's sketch after all. But then, his sketch does things this old plonker doesn't understand as well... Chuck RE: Help with Arduino code - EdK - 04-05-2015 (04-05-2015, 10:09 AM)chucketn Wrote: Me too! Tempted to fix an adult bev and chill. That sounds like a good plan which I may copy. Ed RE: Help with Arduino code - EdK - 04-05-2015 (04-05-2015, 09:57 AM)EdK Wrote: That information helps Chuck. Never mind what I posted above. I see the error of my ways. This code snippet does indeed give you a positive number which is passed to the rotation function. Code: if(Degrees < 0) I'll keep digging when I have a chance. Ed RE: Help with Arduino code - chucketn - 04-05-2015 Thanks, Ed. Whish I had someone close that understood this stuff and could explain it to me. A programming manual is great, but if there's not enough examples to use and try, it doesn't help. Just spent an hour trying to get the keypad to input a # and display it. I copied the keypad stuff from the sketch in question, as I have that part right, and make it display an input. No go. Chuck RE: Help with Arduino code - EdK - 04-05-2015 Chuck, I stripped out all of the LCD and keypad stuff from the sketch so I could run it and I have it stepping in both directions. The bottom trace is the direction and the top the step signal. At least the pins are doing what they're supposed to. Ed [attachment=10484] RE: Help with Arduino code - Vinny - 04-05-2015 Now that we know that, Chuck can you put a scope or voltmeter on the direction pin on the arduino to see if it's actually going low? I'm thinking the stepper driver may be holding the output high. RE: Help with Arduino code - chucketn - 04-05-2015 I can put a volt meter on it, don't have a scope. Will do that in the morning. I don't understand how the driver can hold an input high. Putting a ground on the input causes direction to change. Chuck RE: Help with Arduino code - EdK - 04-05-2015 (04-05-2015, 06:22 PM)chucketn Wrote: I can put a volt meter on it, don't have a scope. Will do that in the morning. I don't believe it's a hardware problem. Something in the software is not doing what it''s expected to do. I'll keep digging. Ed RE: Help with Arduino code - Vinny - 04-05-2015 If on the odd chance the driver has more pull up on it than the arduino has pull down. Or maybe the arduino isn't pulling it down far enough. RE: Help with Arduino code - EdK - 04-06-2015 Given that he's tried two different Arduino pins into the direction pin, I doubt it's hardware. The Arduino has plenty of drive power so that shouldn't be an issue. It's still worth measuring the voltage on the direction pin though just to give us another point of information. Ed |