39 lines
662 B
C++
39 lines
662 B
C++
void setup() {
|
|
// put your setup code here, to run once:
|
|
Serial.begin(9600);
|
|
Serial.println("\"setup\"");
|
|
|
|
}
|
|
|
|
class Panel {
|
|
int A,B;
|
|
public:
|
|
Panel(int one, int two) : A(one), B(two) {
|
|
pinMode(A, OUTPUT);
|
|
pinMode(B, OUTPUT);
|
|
}
|
|
|
|
int Y() {
|
|
digitalWrite(A, 1);
|
|
int result = analogRead(B);
|
|
digitalWrite(A, 0);
|
|
return result;
|
|
}
|
|
|
|
int X() {
|
|
digitalWrite(B, 1);
|
|
int result = analogRead(A);
|
|
digitalWrite(B, 0);
|
|
return result;
|
|
}
|
|
|
|
} panel(A0,A1);
|
|
|
|
void loop() {
|
|
// put your main code here, to run repeatedly:
|
|
Serial.print(panel.X());
|
|
Serial.print("\t");
|
|
Serial.println(panel.Y());
|
|
delay(100);
|
|
}
|