|
|
|
@ -20,26 +20,36 @@ void updateShiftRegister()
|
|
|
|
|
}
|
|
|
|
|
void setTape2()
|
|
|
|
|
{
|
|
|
|
|
out = 0;
|
|
|
|
|
updateShiftRegister();
|
|
|
|
|
bitSet(out,5);
|
|
|
|
|
updateShiftRegister();
|
|
|
|
|
}
|
|
|
|
|
void setTape1()
|
|
|
|
|
{
|
|
|
|
|
out = 0;
|
|
|
|
|
updateShiftRegister();
|
|
|
|
|
bitSet(out,4);
|
|
|
|
|
updateShiftRegister();
|
|
|
|
|
}
|
|
|
|
|
void setAUX()
|
|
|
|
|
{
|
|
|
|
|
out = 0;
|
|
|
|
|
updateShiftRegister();
|
|
|
|
|
bitSet(out,3);
|
|
|
|
|
updateShiftRegister();
|
|
|
|
|
}
|
|
|
|
|
void setTune()
|
|
|
|
|
{
|
|
|
|
|
out = 0;
|
|
|
|
|
updateShiftRegister();
|
|
|
|
|
bitSet(out,2);
|
|
|
|
|
updateShiftRegister();
|
|
|
|
|
}
|
|
|
|
|
void setPh1()
|
|
|
|
|
{
|
|
|
|
|
out = 0;
|
|
|
|
|
updateShiftRegister();
|
|
|
|
|
bitSet(out,1);
|
|
|
|
|
updateShiftRegister();
|
|
|
|
|
}
|
|
|
|
@ -49,26 +59,22 @@ void setup()
|
|
|
|
|
pinMode(latchPin, OUTPUT);
|
|
|
|
|
pinMode(dataPin, OUTPUT);
|
|
|
|
|
pinMode(clockPin, OUTPUT);
|
|
|
|
|
Serial.begin(9600);
|
|
|
|
|
Serial.print("Setting default output");
|
|
|
|
|
bitSet(out,7);
|
|
|
|
|
// Serial.begin(9600);
|
|
|
|
|
// Serial.print("Setting default output");
|
|
|
|
|
bitSet(out,6);
|
|
|
|
|
updateShiftRegister();
|
|
|
|
|
Serial.print("Scanning Matrix");
|
|
|
|
|
// Serial.print("Scanning Matrix");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void loop() {
|
|
|
|
|
// put your main code here, to run repeatedly:
|
|
|
|
|
int mx = analogRead(matrix);
|
|
|
|
|
if (mx > '100' && mx < '200')
|
|
|
|
|
{setTape2();}
|
|
|
|
|
if (mx > '500' && mx < '600')
|
|
|
|
|
{setTape1();}
|
|
|
|
|
if (mx > '900' && mx < '950')
|
|
|
|
|
{setAUX();}
|
|
|
|
|
if (mx > '1000')
|
|
|
|
|
{setTune();}
|
|
|
|
|
if (mx > '820' && mx < '899')
|
|
|
|
|
{setPh1();}
|
|
|
|
|
Serial.println(mx);
|
|
|
|
|
if (mx > 100 && mx < 200) setTape2();
|
|
|
|
|
if (mx > 500 && mx < 600) setTape1();
|
|
|
|
|
if (mx > 900 && mx < 950) setAUX();
|
|
|
|
|
if (mx > 1000) setTune();
|
|
|
|
|
if (mx > 820 && mx < 899) setPh1();
|
|
|
|
|
|
|
|
|
|
// Serial.println(mx);
|
|
|
|
|
delay(200);
|
|
|
|
|
}
|
|
|
|
|