|
@ -1,10 +1,6 @@ |
|
|
/*
|
|
|
/*
|
|
|
* NOTE: this test is for HFS-DC06H |
|
|
* NOTE: this test is for HFS-DC06H |
|
|
* |
|
|
* |
|
|
* ZMHW Changes: |
|
|
|
|
|
* |
|
|
|
|
|
* Using pin 4. This might change depending on PCB revision. Double |
|
|
|
|
|
* check. |
|
|
|
|
|
* |
|
|
* |
|
|
* If the Digital Hi (reads as 1's in serial) doesn't go away, and you are using USB, |
|
|
* If the Digital Hi (reads as 1's in serial) doesn't go away, and you are using USB, |
|
|
* you might need external power. Some USB is not enough. |
|
|
* you might need external power. Some USB is not enough. |
|
@ -12,15 +8,8 @@ |
|
|
* Ethernet draws power, even if library is not active. |
|
|
* Ethernet draws power, even if library is not active. |
|
|
*/ |
|
|
*/ |
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
DigitalReadSerial |
|
|
|
|
|
Reads a digital input on pin 2, prints the result to the serial monitor |
|
|
|
|
|
|
|
|
|
|
|
This example code is in the public domain. |
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
// digital pin 2 has a pushbutton attached to it. Give it a name:
|
|
|
|
|
|
int MotionSensor = 4; |
|
|
|
|
|
|
|
|
int MotionSensor = 8; |
|
|
|
|
|
|
|
|
// the setup routine runs once when you press reset:
|
|
|
// the setup routine runs once when you press reset:
|
|
|
void setup() { |
|
|
void setup() { |
|
@ -36,7 +25,7 @@ void loop() { |
|
|
int MotionState = digitalRead(MotionSensor); |
|
|
int MotionState = digitalRead(MotionSensor); |
|
|
// print out the state of the button:
|
|
|
// print out the state of the button:
|
|
|
Serial.println(MotionState); |
|
|
Serial.println(MotionState); |
|
|
delay(100); // delay in between reads for stability
|
|
|
|
|
|
|
|
|
delay(300); // delay in between reads for stability
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|