Skip to content

Commit

Permalink
fone
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlospi99 committed Mar 6, 2016
1 parent 8d6ca1a commit 3487e64
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions mood-cue
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#include <Servo.h>



Servo myServo;



const int POT_PIN = A0;

int potVal;

int angle;



void setup() {

myServo.attach(9);



Serial.begin(9600);

}



void loop() {

potVal = analogRead(POT_PIN);

Serial.print("potVal: ");

Serial.print(potVal);



angle = map(potVal, 0, 1023, 0, 179);

Serial.print(", angle: ");

Serial.println(angle);



myServo.write(angle);

delay(100);

}

0 comments on commit 3487e64

Please sign in to comment.