62d8bee50f3127876f4e14a0efb8a50c598ee9b6
2 This program is free software: you can redistribute it and/or modify
3 it under the terms of the GNU Affero General Public License as
4 published by the Free Software Foundation, either version 3 of the
5 License, or (at your option) any later version.
7 This program is distributed in the hope that it will be useful,
8 but WITHOUT ANY WARRANTY; without even the implied warranty of
9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 GNU Affero General Public License for more details.
12 You should have received a copy of the GNU Affero General Public License
13 along with this program. If not, see <http://www.gnu.org/licenses/>.
16 // define which pins are connected to which components
17 int left_motor_speed
= 3;
18 int left_motor_forward
= 4;
19 int left_motor_backward
= 5;
21 int right_motor_speed
= 10;
22 int right_motor_forward
= 9;
23 int right_motor_backward
= 8;
26 pinMode(left_motor_speed
, OUTPUT
);
27 pinMode(left_motor_forward
, OUTPUT
);
28 pinMode(left_motor_backward
, OUTPUT
);
30 pinMode(right_motor_speed
, OUTPUT
);
31 pinMode(right_motor_forward
, OUTPUT
);
32 pinMode(right_motor_backward
, OUTPUT
);
34 digitalWrite(left_motor_speed
, LOW
);
35 digitalWrite(left_motor_forward
, LOW
);
36 digitalWrite(left_motor_backward
, LOW
);
38 digitalWrite(right_motor_speed
, LOW
);
39 digitalWrite(right_motor_forward
, LOW
);
40 digitalWrite(right_motor_backward
, LOW
);}
43 digitalWrite(left_motor_forward
, HIGH
);
44 digitalWrite(left_motor_backward
, LOW
);
45 analogWrite(left_motor_speed
, 128);
47 digitalWrite(right_motor_forward
, HIGH
);
48 digitalWrite(right_motor_backward
, LOW
);
49 analogWrite(right_motor_speed
, 128);}