for textbook v4.4
Dependencies: mbed
Connection
Vcc → 3.0V ~ 5.1V (supply voltage)
GND → GND
SIG → p15 (mbed AnalogIn)
NC → Non connection
main.cpp@1:d583c567fcfe, 2019-11-06 (annotated)
- Committer:
- HeptaSatTraining2019
- Date:
- Wed Nov 06 18:14:21 2019 +0000
- Revision:
- 1:d583c567fcfe
- Parent:
- 0:26a3a6edbb11
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbedAustin | 0:26a3a6edbb11 | 1 | #include "mbed.h" |
HeptaSatTraining2019 | 1:d583c567fcfe | 2 | AnalogIn sensorUV(p15); |
HeptaSatTraining2019 | 1:d583c567fcfe | 3 | float UVvalue; |
mbedAustin | 0:26a3a6edbb11 | 4 | int main() { |
mbedAustin | 0:26a3a6edbb11 | 5 | while (true) { |
HeptaSatTraining2019 | 1:d583c567fcfe | 6 | UVvalue = sensorUV; |
HeptaSatTraining2019 | 1:d583c567fcfe | 7 | printf("\rUV Value = %3.2f%%\r\n",UVvalue*100); |
HeptaSatTraining2019 | 1:d583c567fcfe | 8 | wait(1.0); |
mbedAustin | 0:26a3a6edbb11 | 9 | } |
mbedAustin | 0:26a3a6edbb11 | 10 | } |