potentiometer – Kevin Gulling http://www.kevingulling.com Game Development, VR, and more Tue, 20 Dec 2016 05:29:19 +0000 en-US hourly 1 https://wordpress.org/?v=5.9.13 81085834 12 Days of Arduino Day 7 – Binary Beat Counter https://kevingulling.com/2016/12/1335/ https://kevingulling.com/2016/12/1335/#comments Mon, 19 Dec 2016 22:29:19 +0000 https://kevingulling.com/?p=1335 It’s day 7 of 12 Days of Arduino! On the seventh day of Arduino… We clean up the circuit for better access to controls and fill up those empty outputs on the shift register with LED’s for a true party in your pocket! Errr… Maybe that isn’t the best slogan for the Keyduino… Let’s get […]

The post 12 Days of Arduino Day 7 – Binary Beat Counter appeared first on Kevin Gulling - Game Development, VR, and more.

]]>
Keyduino day 7

It’s day 7 of 12 Days of Arduino! On the seventh day of Arduino… We clean up the circuit for better access to controls and fill up those empty outputs on the shift register with LED’s for a true party in your pocket! Errr… Maybe that isn’t the best slogan for the Keyduino… Let’s get to it!

Keyduino 0.9a

Keyduino 0.9a

Project requires
–Arduino Uno
–Active buzzer
–3x button touch switch
-220 ohm resistor
-4x 10k ohm resistor
-8x 220 ohm resistor
-Jumper wires
-Tip120
-SN74HC595
-Photoresistor
-Potentiometer
-7x LED



Beat Counter Sketch

Beat Counter Sketch


//Pin connected to ST_CP of 74HC595
int latchPin = 8;
//Pin connected to SH_CP of 74HC595
int clockPin = 12;
////Pin connected to DS of 74HC595
int dataPin = 11;
int number = 1;
int speakerPin = 6;
//Buttons
int button1Pin = 2;
int button2Pin = 3;
int button3Pin = 4;
int photoresistorPin = A0;
int sensorValue = 0;
int photoresistorSensitivity = 2;
void setup() {
Serial.begin(9600);
pinMode(latchPin, OUTPUT);
pinMode(clockPin, OUTPUT);
pinMode(dataPin, OUTPUT);
pinMode(speakerPin, OUTPUT);
pinMode(button1Pin, INPUT);
pinMode(button2Pin, INPUT);
pinMode(button3Pin, INPUT);
}

void loop() {
int potentiometerValue;
potentiometerValue = analogRead(1);
if(potentiometerValue < 10){ potentiometerValue = 10; } if(digitalRead(button1Pin) == HIGH){ sensorValue = analogRead(photoresistorPin); tone(speakerPin, 790 +(sensorValue*photoresistorSensitivity));//A5 digitalWrite(latchPin, LOW); // shift out the bits: shiftOut(dataPin, clockPin, MSBFIRST, number); digitalWrite(latchPin, HIGH); delay(potentiometerValue); number++; } else if(digitalRead(button2Pin) == HIGH){ sensorValue = analogRead(photoresistorPin); tone(speakerPin, 1750 +(sensorValue*photoresistorSensitivity));//A6 digitalWrite(latchPin, LOW); // shift out the bits: shiftOut(dataPin, clockPin, MSBFIRST, number); digitalWrite(latchPin, HIGH); delay(potentiometerValue); number++; } else if(digitalRead(button3Pin) == HIGH){ sensorValue = analogRead(photoresistorPin); tone(speakerPin, 3510+(sensorValue*photoresistorSensitivity));//A7 digitalWrite(latchPin, LOW); shiftOut(dataPin, clockPin, MSBFIRST, number); digitalWrite(latchPin, HIGH); delay(potentiometerValue); number++; } else{ number = 0; digitalWrite(latchPin, LOW); // shift out the bits: shiftOut(dataPin, clockPin, MSBFIRST, number); digitalWrite(latchPin, HIGH); delay(10); } }

There isn't much difference in the code today, in fact yesterdays sketch works just fine with this circuit, but I made some minor improvements to the code, opening up the ability to easily control the sensitivity of the photoresistor's pitch bending FX.

I hope you all enjoyed the "Keyduino". I'm probably going to tear it down for parts tomorrow and get to the next project but it shall be immortalized here and on Youtube, if there is any demand, I'll model a case for it for 3d printing, so if you are a DJ or just a hobbyist and you want the Keyduino contained in a plastic shell, let me know!

ICStation.com for an infinite supply of fun:


The post 12 Days of Arduino Day 7 – Binary Beat Counter appeared first on Kevin Gulling - Game Development, VR, and more.

]]>
https://kevingulling.com/2016/12/1335/feed/ 1 1335
12 Days of Arduino – Day 6 – Potentiometer Control Knob https://kevingulling.com/2016/12/12-days-of-arduino-day-6-potentiometer-knob-on-the-keyduino/ Sun, 18 Dec 2016 20:44:15 +0000 https://kevingulling.com/?p=1323 Welcome back to day 6 of 12 Days of Arduino! 12 pointless Arduino projects from me to you! The word of the day today is Potentiometer. I use a potentiometer from keyestudios to control the length of delay between bits shifting through the register! Magnificent! Project requires –Arduino Uno –Active buzzer –3x button touch switch […]

The post 12 Days of Arduino – Day 6 – Potentiometer Control Knob appeared first on Kevin Gulling - Game Development, VR, and more.

]]>
day 6 potentiometer knob

Welcome back to day 6 of 12 Days of Arduino! 12 pointless Arduino projects from me to you! The word of the day today is Potentiometer. I use a potentiometer from keyestudios to control the length of delay between bits shifting through the register! Magnificent!



Project requires
–Arduino Uno
–Active buzzer
–3x button touch switch
-220 ohm resistor
-4x 10k ohm resistor
-2x 220 ohm resistor
-Jumper wires
-Tip120
-SN74HC595
-Photoresistor
-Potentiometer
-RGB LED

Keyduino with Potentiometer Control Knob


//Pin connected to ST_CP of 74HC595
int latchPin = 8;
//Pin connected to SH_CP of 74HC595
int clockPin = 12;
////Pin connected to DS of 74HC595
int dataPin = 11;
int number = 1;
int speakerPin = 6;
//Buttons
int button1Pin = 2;
int button2Pin = 3;
int button3Pin = 4;
int photoresistorPin = A0;
int sensorValue = 0;

void setup() {
Serial.begin(9600);
pinMode(latchPin, OUTPUT);
pinMode(clockPin, OUTPUT);
pinMode(dataPin, OUTPUT);
pinMode(speakerPin, OUTPUT);
pinMode(button1Pin, INPUT);
pinMode(button2Pin, INPUT);
pinMode(button3Pin, INPUT);
}

void loop() {
int potentiometerValue;
potentiometerValue = analogRead(1);
if(potentiometerValue < 10){ potentiometerValue = 10; } if(digitalRead(button1Pin) == HIGH){ sensorValue = analogRead(photoresistorPin); tone(speakerPin, 790 +(sensorValue*2));//A5 digitalWrite(latchPin, LOW); // shift out the bits: shiftOut(dataPin, clockPin, MSBFIRST, number); digitalWrite(latchPin, HIGH); delay(potentiometerValue); number++; } else if(digitalRead(button2Pin) == HIGH){ sensorValue = analogRead(photoresistorPin); tone(speakerPin, 1750 +(sensorValue*2));//A6 digitalWrite(latchPin, LOW); // shift out the bits: shiftOut(dataPin, clockPin, MSBFIRST, number); digitalWrite(latchPin, HIGH); delay(potentiometerValue); number++; } else if(digitalRead(button3Pin) == HIGH){ sensorValue = analogRead(photoresistorPin); tone(speakerPin, 3510+(sensorValue*2));//A7 digitalWrite(latchPin, LOW); shiftOut(dataPin, clockPin, MSBFIRST, number); digitalWrite(latchPin, HIGH); delay(potentiometerValue); number++; } else{ number = 0; digitalWrite(latchPin, LOW); // shift out the bits: shiftOut(dataPin, clockPin, MSBFIRST, number); digitalWrite(latchPin, HIGH); delay(10); } }

I have to admit I was having a little bit of fun playing this... I might just have to add a 1/4" jack so we can amplify this guy 👍👍

ICStation.com the best source for electric components on the cheap:


The post 12 Days of Arduino – Day 6 – Potentiometer Control Knob appeared first on Kevin Gulling - Game Development, VR, and more.

]]>
1323