File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed
Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change 2121
2222 https://www.arduino.cc/en/Tutorial/BuiltInExamples/Blink
2323*/
24-
24+ #include < ESP32Servo.h>
25+ Servo left;
26+ Servo right;
2527// the setup function runs once when you press reset or power the board
2628void setup () {
27- // initialize digital pin LED_BUILTIN as an output.
28- pinMode (LED_BUILTIN, OUTPUT);
29+ left.attach (33 );
30+ right.attach (32 );
31+ left.write (90 );
32+ right.write (90 );
33+
2934}
3035
3136// the loop function runs over and over again forever
3237void loop () {
33- digitalWrite (LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
38+ left.write (0 );
39+ right.write (0 );
3440 delay (1000 ); // wait for a second
35- digitalWrite (LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
41+ left.write (180 );
42+ right.write (180 );
3643 delay (1000 ); // wait for a second
3744}
You can’t perform that action at this time.
0 commit comments