Hi, I would like to make a program so that a robot will follow the directions I give. What I want to do is have a load of buttons in a piece of software that say things like turn right, turn left e.t.c What I wan't it to do is :
I press a button like turn right
This is added to a list of commands
when I am ready I press upload
It uploads a list of commands like
servo.write(10);
delay(1000);
servo.write(90);
obviously this will be inserted into the rest of the code so it compiles properly. Question is though how do I do that, can someone point me towards a tutorial for making a program like that, any coding language will do.
The Code for the Arduino is stored in Flash, so uploading C code is not really possible. What you are aiming at requires some kind of interpreter. Eiter you send strings to the Arduino that you parse on your own or you use some already existing interpreter.
It might be most easy to start with parsing strings and then executing the desired commands.
Hi, thanks for the quick reply ! I think it might just be easier for me to make a simple program that just writes the code for me so I can just copy and paste it over to the arduino IDE, which would still be quicker than typing it out bit by bit every time.
This allows you to easily control I/O on the arduino from another program running on your PC. A good choice is Processing. So you have your buttons read, sent up to processing which converts them into sequences and then back into the arduino again.
Alternatively if you want stand alone then just write code to do what you want.
Hi, thanks for the help both of you and I will probably just write the code like you said grumpy mike until I can get some sensors and make it autonomous instead