Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Adafruit_CircuitPlayground.h>
- #include <Adafruit_Circuit_Playground.h>
- //Servo code
- #include <Servo.h>
- Servo servo1;
- void setup() {
- // put your setup code here, to run once:
- CircuitPlayground.begin();
- servo1.attach(10); //pin 10
- }
- bool stop = false;
- void loop() {
- // put your main code here, to run repeatedly:
- if (CircuitPlayground.leftButton() == true) {
- if (stop == false)
- stop = true;
- else
- stop = false;
- }
- if (stop == true){
- servo1.write(0);
- }
- else
- servo1.write(180);
- delay(100);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement