Smart of night demonstration project. Color of light fades from blue to green to red as it gets darker.
Fork of Nightlight2 by
Diff: main.cpp
- Revision:
- 1:4647b43d61ef
- Parent:
- 0:8ed2f4a2a2fe
- Child:
- 2:5682a72277ed
- Child:
- 3:7448a1637704
--- a/main.cpp Mon Mar 27 12:49:02 2017 +0000 +++ b/main.cpp Mon Mar 27 14:29:20 2017 +0000 @@ -5,7 +5,7 @@ Reads from analog input, streams ASCII text to std serial using printf, and lights onboard LED. Also demonstrates use of floating point literal sufix to eliminate warning and int constants for HIGH and LOW. This version uses - overloaded operators. + overloaded operators and sends LED state read from DigitalOut object. Written by: Dr. C. S. Tritt Created: 3/26/17 (v. 1.0) @@ -34,6 +34,7 @@ else { led = LOW; } + printf("LED = %d\n", (int) led); // Send LED state as serial text. wait(0.25); // 250 ms } }