projects
/
svn42.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2a39bef
)
Photo Resistor
author
Bernhard Tittelbach
<xro@realraum.at>
Sat, 6 Mar 2010 15:53:02 +0000
(15:53 +0000)
committer
Bernhard Tittelbach
<xro@realraum.at>
Sat, 6 Mar 2010 15:53:02 +0000
(15:53 +0000)
rf433ctl/rf433ctl.pde
patch
|
blob
|
history
diff --git
a/rf433ctl/rf433ctl.pde
b/rf433ctl/rf433ctl.pde
index
9837f3e
..
f77efcf
100644
(file)
--- a/
rf433ctl/rf433ctl.pde
+++ b/
rf433ctl/rf433ctl.pde
@@
-10,6
+10,7
@@
#define IR_MOVEMENT_PIN 9
#define ONE_WIRE_PIN 8
#define PANIC_BUTTON_PIN 7
#define IR_MOVEMENT_PIN 9
#define ONE_WIRE_PIN 8
#define PANIC_BUTTON_PIN 7
+#define PHOTO_ANALOGPIN 1
//movement is reported if during IR_SAMPLE_DURATION at least IR_TRESHOLD ir signals are detectd
#define IR_SAMPLE_DURATION 20000
#define IR_TRESHOLD 13000
//movement is reported if during IR_SAMPLE_DURATION at least IR_TRESHOLD ir signals are detectd
#define IR_SAMPLE_DURATION 20000
#define IR_TRESHOLD 13000
@@
-208,6
+209,14
@@
void printTemperature(DeviceAddress deviceAddress)
//********************************************************************//
//********************************************************************//
+void printLightLevel(unsigned int pin)
+{
+ Serial.print("Photo: ");
+ Serial.println(analogRead(pin));
+}
+
+//********************************************************************//
+
void setup()
{
pinMode(RF_DATA_OUT_PIN, OUTPUT);
void setup()
{
pinMode(RF_DATA_OUT_PIN, OUTPUT);
@@
-308,6
+317,8
@@
void loop()
send_frame(words[D2_OFF]);
else if(command == 'T')
printTemperature(onShieldTemp);
send_frame(words[D2_OFF]);
else if(command == 'T')
printTemperature(onShieldTemp);
+ else if(command == 'P')
+ printLightLevel(PHOTO_ANALOGPIN);
else
Serial.println("Error: unknown command");
else
Serial.println("Error: unknown command");