Let's Make Robots!

StartHere robot - Arduino

AttachmentSize
startHereRobot.pde2.29 KB

I thought it was one of the rule to join the great community, so I spend this weekend to make this "Start Here" robot by using Arduino with motor shield from AdaFruit. Basically it just detect the object and turn right. There's whole lots of room could expand its ability.

The code is simple but I probably make it way too long and I alway confuse about one thing. Should I keep sending the forward command to have motor keep going or I should stop sending when there's no need to tell motor to keep going? That's why I have add "if(excute == true)" in order to have FORWARD send only once. or there's better way to do this? Thanks for any input!


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Can someone tell me how to add the file in the post?

There is a link called "file attachments" at the bottom of the page when you choose to edit the post. 

There should be a button called "attach file" or "add attachment." I'd just command/control f for it. For Arduino code, it might be necessary to zip the file for it to upload. 

Thanks!!

You are right!! Thanks for your advice. I actually wanna add more stuff on top of it but they just too heavy for these small motors. :<

Good looking Start Here robot ! I like the metallic frame :)

I'm not familiar with Arduino yet, but I think you don't need to keep sending the forward command. You just need to recall the MoveForward() method if you call another method that changes the speed or direction of a motor. In your case, if sending the forward command doesn't change anything, the code would be easier to read and update without the variable.

If you want to keep the variable, you can remove the "if(excute == true)", because it is always true :)