Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int softpotPin = A5;
- void setup() {
- Serial.begin(9600);
- digitalWrite(softpotPin, HIGH);
- }
- void loop() {
- int softpotReading = analogRead(softpotPin);
- int pitchpot = round(softpotReading * (127/1020));
- float test = (softpotReading / 1020) * 127;
- Serial.println(softpotReading);
- // returns btwn 1020 and 0 based on where I touch the potentiometer, default w/ no touch is 1020
- Serial.println(test, 5);
- // returns 0
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement