/
GSR.pde
41 lines (32 loc) · 824 Bytes
/
GSR.pde
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
* Copyright (c) 2011 Nokia Corporation
*
* This file is part of the Push Snowboarding Project, More info at:
* http://pushsnowboarding.com/tech/developer-centre/
*
* This file is under the GPLv3 License, more details at:
* http://www.gnu.org/licenses/
*
*/
/*
* Arduino responds to char 'A' from the serial port.
* Replies with:
* GSR,<value>,END;
*/
//GSR, arduino pro mini 3.3v connected to analog in port 3 with a 300K resistor tied to ground talking to bluetooth at 115200 Baud on a bluetooth mate.
void setup()
{
Serial.begin(115200);
}
void loop() {
if(Serial.available() > 0){
char inByte = Serial.read();
if (inByte == 'A'){
int a=analogRead(3);
Serial.print("GSR,");
Serial.print(a);
Serial.println(",END;");
}
Serial.flush();
}
}