Go Down

Topic: Car that beeps (Read 73 times) previous topic - next topic

erinmags

So I am trying to code for a car controlled by an Arduino Uno that needs to start from the middle of an open box, touch the right wall and play a tone, touch the left wall and play a tone, then return back to it's starting position.

So far I have code with states for turning left, right, going forward and backward, but I am unsure how to string them together.

groundFungus

More members will see your code if you post your code as described in the forum guidelines.
You will save everyone's time if you read and follow the forum guidelines.  :)          
https://forum.arduino.cc/index.php/topic,148850.0.html
and
https://forum.arduino.cc/index.php?topic=97455.0

vaj4088

I cannot see your code on my mobile device if you do not follow the instructions.


StefanL38

What I write here may sound a bit rude. It is not meant rude. It is meant to be clear and easy to understand.

If you want help you should make it as much comfortable for your potential helpers instead of making it most comfortable for you. Post code inside code-tags. 

In your code add your first approach how you think the code inside your state1(), state2()-function looks like 
It does not even have to compile. Just a small starting point that shows some effort invested by YOU

or as an alternative 

post at least one single BUT CONCRETE question about one line of code instead of a generalised question like

Quote
"So far I have code with states for turning left, right, going forward and backward, but I am unsure how to string them together."
What your code shows so far is copy&paste from a tutorial and a few minor changes to the copied code.


best regards Stefan 
any newbee can apply the most professional habit right from the start:
 add only ONE thing at a time. Debug that ONE thing until that ONE thing works reliable - repeat.
Newbee: become a professional by following this rule.

Go Up