for textbook v4.4

Dependencies:   mbed

Connection

Vcc → 3.0V ~ 5.1V (supply voltage)

GND → GND

SIG → p15 (mbed AnalogIn)

NC → Non connection

Revision:
1:d583c567fcfe
Parent:
0:26a3a6edbb11
--- a/main.cpp	Fri Sep 05 03:00:54 2014 +0000
+++ b/main.cpp	Wed Nov 06 18:14:21 2019 +0000
@@ -1,12 +1,10 @@
 #include "mbed.h"
-
-AnalogIn sensorUV(A0);
-
+AnalogIn sensorUV(p15);
+float UVvalue;
 int main() {
-    float value;
     while (true) {
-        value = sensorUV;
-        printf("\rUV Value = %3.2f%%",value*100);
-        wait(.1);
+        UVvalue = sensorUV;
+        printf("\rUV Value = %3.2f%%\r\n",UVvalue*100);
+        wait(1.0);
     }
 }