-
Recommended Servo
07/16/2018 at 10:32 • 0 commentsI recommend using this servo as it is waterproof and has enough torque.
Link:- click here
-
Servo Single Push Button Code
07/16/2018 at 09:40 • 0 comments#include <Servo.h>;
// pushbutton pin
const int buttonPin = 2;// servo pin
const int servoPin = 9;
Servo servo;//create a variable to store a counter and set it to 0
int counter = 0;
void setup()
{
servo.attach (servoPin);
// Set up the pushbutton pins to be an input:
pinMode(buttonPin, INPUT);
}void loop()
{
int buttonState;buttonState = digitalRead(buttonPin);
if (buttonState == LOW) // light the LED
{
counter++;
delay(150);
}if(counter == 0)
{
servo.write (0);}
else if(counter == 1 ){
servo.write (180);
}
else
{
counter = 0;
}
}
} -
Servo 2 Push Button Code
07/16/2018 at 09:02 • 0 comments#include<Servo.h> int pos = 0; Servo servo; void setup() { pinMode(2, INPUT); pinMode(3, INPUT); servo.attach(9); } void loop() { while (digitalRead(2) == HIGH && pos < 180) { pos++; servo.write(pos); delay(10); } while (digitalRead(3) == HIGH && pos > 0) { pos--; servo.write(pos); delay(10); } }
-
Safety First
07/16/2018 at 08:58 • 0 commentsThis is a voltage regulator connect the positive end of rectifier to Vin and negative to GND and Vout to the storage in my case powerbank .This will ensure that your power storage is safely and no excess voltage is supplied to the power bank .
Pololu 5V Step-Up/Step-Down Voltage Regulator S7V7F5