top of page
ROBOT MAGIC
CHAPTER Five: Spring Snake with Brains


Copy + Paste this code to your Arduino Sketch:
#include <Servo.h>
Servo snake; //Let’s call the servo snake!
void setup(){
snake.attach(8);
snake.write(160); // move to start position before we begin
}
void loop(){
delay(10000); // wait 10 seconds before the snake pops
snake.write(30); // the snake pops!
delay(5000); // wait 5 seconds
snake.write(160); // move back to starting position
delay(50000); // here we wait 50 seconds
}

A variation of the routine for your inspiration:
bottom of page