Last change
on this file since 78394ea was 78394ea, checked in by njw <njw@…>, 16 years ago |
added more info about compile cycle
|
-
Property mode
set to
100644
|
File size:
1.0 KB
|
Line | |
---|
1 | /*
|
---|
2 | * HotHotHeat
|
---|
3 | *
|
---|
4 | * Compile with the Arduino IDE (http://arduino.cc); is deployed against a
|
---|
5 | * Atmel Butterfly - so you also need the Butteruino project
|
---|
6 | * (http://code.google.com/p/butteruino/)
|
---|
7 | *
|
---|
8 | * ...will
|
---|
9 | * 1) Read the Butterfly temperature sensor and output
|
---|
10 | * the result permanently to UART.
|
---|
11 | *
|
---|
12 | * 2) Read a reed sensor and output
|
---|
13 | * the result permanently to UART
|
---|
14 | *
|
---|
15 | * Contact: Norbert Wigbels
|
---|
16 | * (http://foobla.wigbels.de/uber-foobla/)
|
---|
17 | *
|
---|
18 | * Format: <# of Sensor> <data>
|
---|
19 | * Example: 1; Temperature in Celsius
|
---|
20 | * tbd.
|
---|
21 | */
|
---|
22 |
|
---|
23 | #include <butterfly_temp.h>
|
---|
24 | #include <pins_butterfly.h>
|
---|
25 |
|
---|
26 | int inputPin = PBPIN4;
|
---|
27 | int value = 0;
|
---|
28 |
|
---|
29 |
|
---|
30 | void setup() {
|
---|
31 | Serial.begin(9600);
|
---|
32 | pinMode(inputPin, INPUT);
|
---|
33 | }
|
---|
34 |
|
---|
35 | void getSamples(){
|
---|
36 | Serial.print("1");
|
---|
37 | Serial.print("\t");
|
---|
38 | Serial.print(TempSense.getTemp(CELSIUS));
|
---|
39 | Serial.println();
|
---|
40 |
|
---|
41 | value = digitalRead(inputPin);
|
---|
42 | if (value == HIGH) {
|
---|
43 | Serial.println("HIGH");
|
---|
44 | }
|
---|
45 | else {
|
---|
46 | Serial.println("LOW");
|
---|
47 | }
|
---|
48 | }
|
---|
49 |
|
---|
50 | void loop() {
|
---|
51 | TempSense.overSample = true;
|
---|
52 | getSamples();
|
---|
53 | delay(400);
|
---|
54 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.