Last change
on this file since 454b95c was
454b95c,
checked in by njw <njw@…>, 15 years ago
|
added hothotheat in/and de.wigbels.avr
|
-
Property mode set to
100644
|
File size:
799 bytes
|
Line | |
---|
1 | /* |
---|
2 | * HotHotHeat |
---|
3 | * |
---|
4 | * 1) Read the Butterfly temperature sensor and output |
---|
5 | * the result permanently to UART. |
---|
6 | * |
---|
7 | * 2) Read a reed sensor and output |
---|
8 | * the result permanently to UART |
---|
9 | * |
---|
10 | * Norbert Wigbels |
---|
11 | * |
---|
12 | * Format: <# of Sensor> <data> |
---|
13 | * Example: 1; Temperature in Celsius |
---|
14 | * tbd. |
---|
15 | */ |
---|
16 | |
---|
17 | #include <butterfly_temp.h> |
---|
18 | #include <pins_butterfly.h> |
---|
19 | |
---|
20 | int inputPin = PBPIN4; |
---|
21 | int value = 0; |
---|
22 | |
---|
23 | |
---|
24 | void setup() { |
---|
25 | Serial.begin(9600); |
---|
26 | pinMode(inputPin, INPUT); |
---|
27 | } |
---|
28 | |
---|
29 | void getSamples(){ |
---|
30 | Serial.print("1"); |
---|
31 | Serial.print("\t"); |
---|
32 | Serial.print(TempSense.getTemp(CELSIUS)); |
---|
33 | Serial.println(); |
---|
34 | |
---|
35 | value = digitalRead(inputPin); |
---|
36 | if (value == HIGH) { |
---|
37 | Serial.println("HIGH"); |
---|
38 | } |
---|
39 | else { |
---|
40 | Serial.println("LOW"); |
---|
41 | } |
---|
42 | } |
---|
43 | |
---|
44 | void loop() { |
---|
45 | TempSense.overSample = true; |
---|
46 | getSamples(); |
---|
47 | delay(400); |
---|
48 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.