30
edits
Changes
no edit summary
And Here's the code!
int turn1 = 12; // choose the pins for controlling direction <br> int turn2 = 13;<br> int tilt1 = 4; // choose the input pin (for the tilt sensors)<br> int tilt2 = 5;<br> int val1 = 0; // variable for reading the pin status<br> int val2 = 0;<br> void setup() {<br> pinMode(turn1, OUTPUT); // declare turn pins as output<br> pinMode(turn2, OUTPUT);<br> pinMode(tilt1, INPUT); // declare tilt sensors as input<br> pinMode(tilt2, INPUT);<br>
void loop(){ val1 = digitalRead(tilt1); // read input value val2 = digitalRead(tilt2);
[[User:S8brown/Project | Other Projects]]