top of page

ROBOT MAGIC

CHAPTER Five: Spring Snake with Brains

Watercolor Stain
Make_RobotMagic_Cover_01jb.jpg

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

 

}

snakebot.PNG

A variation of the routine for your inspiration:

Show us your finished projects! Use #robotmagic in your social media posts and tag Mario!

  • Facebook
  • Instagram
  • Twitter
  • YouTube
  • TikTok
bottom of page