Close
0%
0%

Yes-No thing

An electronic excise and a table piece made for a themed party. A basic exercise in physical input-output using a servo logic.

Similar projects worth following
  • Description
  • Details
  • Files 0
  • Components 0
  • Logs 0
  • Instructions 0
  • Discussion 0
A breadboard with a servo, joystick, arduino nano, and a usb-to-serial adapter all sitting on a usb charger. A very short arduino code. Short video here; http://imgur.com/4vqcXPh

//
// Yes-No
// wp
//
// arduino nano - servo - joystick
//
// servo input -> D2
// joystick axis -> A1
//

#include

Servo myservo; // create servo object

int pos = 0; // servo position
const int joyH = 1; // pin A1 for joystick axis

void setup() {
myservo.attach(2); // attaches the servo on pin D2
Serial.begin(9600);
}

void loop() {
pos = analogRead(joyH);
pos = map(pos, 0, 1023, 0, 180); // rescale joystick value
myservo.write(pos); // command servo to 'pos'
delay(15); // for servo actuation
}

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates