Green Tea Maker

180

1

1

About: Since 2018, Electronics & Arduino Hobby has been committed to helping the world achieve electronics literacy. No matter your vision or skill level, our products and resources are designed to make electro...

#include Servo myservo; // create servo object to control a servo

int pos = 0; // variable to store the servo position const

int buttonPin = 4; //variables will change

int buttonState = 0;

int flag = 0;

void setup()

{

myservo.attach(3); // attaches the servo on pin 9 to the servo object pinMode(buttonPin, INPUT); }

void loop()

{

buttonState = digitalRead(buttonPin);

if (buttonState == HIGH) {

//check if the pushbutton is pressed

flag = 1;

for(int i=0; i <= 45; i++){

myservo.write(120); // tell servo to go to position in variable 'pos'

delay(1500);

myservo.write(0);

delay(1500); }

} else {

flag =0; //

digitalWrite(ledPin, LOW); // turn LED off

// Serial.println("LED OFF -------"); }

}

Share

    Recommendations

    • Arduino Contest 2019

      Arduino Contest 2019
    • Tape Contest

      Tape Contest
    • Trash to Treasure

      Trash to Treasure

    Discussions

    0
    None
    DIY Hacks and How Tos

    3 months ago

    Nice design. If I had one of these maybe I wouldn't over steep my tea for once.