root / trunk / code / projects / calibration_platform / station / cal_sta_station / cal_sta_station.pde @ 1941
History | View | Annotate | Download (554 Bytes)
1 |
#define NUM_INPUTS 2 |
---|---|
2 |
|
3 |
int input_pins[NUM_INPUTS] = {0,1}; // Input Pin Numbers |
4 |
int input_vals[NUM_INPUTS] = {0,0}; |
5 |
|
6 |
void setup() { |
7 |
Serial.begin(9600); // Actual baud rate appears to be 19200 |
8 |
} |
9 |
|
10 |
void loop() { |
11 |
// Collect data |
12 |
int i; |
13 |
for (i = 0; i < NUM_INPUTS; i++) { |
14 |
input_vals[i] = analogRead(input_pins[i]); |
15 |
} |
16 |
|
17 |
// Send data to Station |
18 |
for (i = 0; i < NUM_INPUTS; i++) { |
19 |
Serial.print("ST:"); |
20 |
Serial.print(input_pins[i]); |
21 |
Serial.print(":"); |
22 |
Serial.print(input_vals[i]); |
23 |
Serial.print("\n"); |
24 |
} |
25 |
delay(5000); |
26 |
} |