Go Down

Topic: Arduino LIFT project( do while problem) (Read 233 times) previous topic - next topic

Delta_G

Your syntax is off.  Seriously, go look at a C++ tutorial.  It will help you.  You need braces around the body and no semicolon after the parenthesis on the first line. 


You're also reading buttons in here and setting the target floor.  This function shouldn't do that.  All it needs to do is determine what floor you are currently on.  NOTHING ELSE.  It shouldn't read anything but the sonar sensor.  It shouldn't read buttons.  It shouldn't try to determine where you're going.  It shouldn't run a motor.  All it needs to do is to figure out what floor you are currently on. 

Once we are able to determine our current position THEN we will write another function that reads the buttons and figures out the target.  But forget that for now.  All your code should do at the end of this exercise is figure out what floor you are currently on. 
|| | ||| | || | ||  ~Woodstock

Please do not PM with technical questions or comments.  Keep Arduino stuff out on the boards where it belongs.

Go Up