StartHere robot - Arduino

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!


  • Actuators / output devices: motors
  • Control method: autonomous
  • Power source: 9v battery
  • Sensors / input devices: 1 Sharp Distance Sensors
  • Target environment: indoor ground

This is a companion discussion topic for the original entry at https://community.robotshop.com/robots/show/starthere-robot-arduino

Good looking Start Here

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

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 :slight_smile:

 

 

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. :<

Can someone tell me how to

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

Attach File

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. 

**Its at the Bottom. **

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

Thanks!!

Thanks!!