Twin VlogIzzy
Published

Watering Wilbert!

If anyone from around the world tweets "Water @WilbertThePlant" the red solo cup attached to the bamboo will flip and water Wilbert.

IntermediateProtip1,103
Watering Wilbert!

Things used in this project

Hardware components

5 mm LED: Red
5 mm LED: Red
×1
Jumper wires (generic)
Jumper wires (generic)
×1
4xAA battery holder
4xAA battery holder
×1
SG90 Micro-servo motor
SG90 Micro-servo motor
×1
Breadboard (generic)
Breadboard (generic)
×1

Software apps and online services

Maker service
IFTTT Maker service
Particle Pi
Particle Pi
Twitter
Twitter

Hand tools and fabrication machines

Multitool, Screwdriver
Multitool, Screwdriver
Hot glue gun (generic)
Hot glue gun (generic)

Story

Read more

Code

Untitled file

C/C++
Servo servo1;
//This is the servo
int red = D6;
//The light turn red when the servo moves

int servoposition1=0;
// The servo starts at position 0

void setup() 
{
    servo1.attach(A4);
    servo1.write(0);
    Particle.function("waterme",waterMe);
    //When connected to IFTT the function to make the servo move is called waterme
    pinMode(red, OUTPUT);
    //When the servo moves the light turns red
}

int waterMe (String tweet){
    if (tweet == "Water @WilbertThePlant"){
        //To make the servo move and water plant you must tweet "Water @WilbertThePlant"
    servo1.write(180);
    delay(1000);
    servo1.write(0);
    digitalWrite(red,HIGH);
    delay(500);
    digitalWrite(red,LOW);
    delay(500);
    digitalWrite(red,HIGH);
    delay(500);
    digitalWrite(red,LOW);
    return 0;
    //The servo returns to position 0
} else return -1;

}


void loop();

Credits

Twin Vlog

Twin Vlog

1 project • 0 followers
Izzy

Izzy

1 project • 1 follower
New to this stuff
Thanks to Gabby Ziemer.

Comments