圖片來自 http://www.ltc.com.tw/ |
// (C) 2015, Bridan Wang, CC BY-NC-SA 3.0 TW
// http://4rdp.blogspot.tw/search/label/ROSA%20(Arduino)
// http://4rdp.blogspot.tw/search/label/ROSA%20(Arduino)
// normal pin control
byte D_IN(byte p){
pinMode(p, INPUT);
return digitalRead(p);
}
unsigned int A_IN(byte p){
pinMode(p, INPUT);
return analogRead(p);
}
void PROCESS_1sec(void){
Serial.print("A0 - (Y) ");
Serial.println(A_IN(A0));
Serial.print("A1 - (X) ");
Serial.println(A_IN(A1));
Serial.print("A2 - (B) ");
Serial.println(D_IN(A2));
}