Skip to content

Instantly share code, notes, and snippets.

@buildcircuit
Created September 16, 2015 03:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save buildcircuit/3c3d648118825c0682fd to your computer and use it in GitHub Desktop.
Save buildcircuit/3c3d648118825c0682fd to your computer and use it in GitHub Desktop.
/*arduino touch 8
VCC-----------5V
GND-----------GND
OUT1-----------2
OUT2-----------3
OUT3-----------4
OUT4-----------5
OUT5-----------6
OUT6-----------7
OUT7-----------8
OUT8-----------9
*/
void setup()
{
pinMode(2,INPUT);
pinMode(3,INPUT);
pinMode(4,INPUT);
pinMode(5,INPUT);
pinMode(6,INPUT);
pinMode(7,INPUT);
pinMode(8,INPUT);
Serial.begin(9600);
// put your setup code here, to run once:
}
void loop()
{
unsigned char i,j;
for(i=2;i<10;i++)
{
if(digitalRead(i))
{
delay(80);
if(digitalRead(i))
{
Serial.print(i-1);
}
while(digitalRead(i));
}
}
// put your main code here, to run repeatedly:
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment