for textbook v4.4

Dependencies:   mbed

Connection

Vcc → 3.0V ~ 5.1V (supply voltage)

GND → GND

SIG → p15 (mbed AnalogIn)

NC → Non connection

Committer:
mbedAustin
Date:
Fri Sep 05 03:00:54 2014 +0000
Revision:
0:26a3a6edbb11
Child:
1:d583c567fcfe
Seeed Grove UV Sensor example. Very simple initial commit. Takes in voltage from ADC and reports it to the user via terminal as % of total voltage. ~10% = indoors

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbedAustin 0:26a3a6edbb11 1 #include "mbed.h"
mbedAustin 0:26a3a6edbb11 2
mbedAustin 0:26a3a6edbb11 3 AnalogIn sensorUV(A0);
mbedAustin 0:26a3a6edbb11 4
mbedAustin 0:26a3a6edbb11 5 int main() {
mbedAustin 0:26a3a6edbb11 6 float value;
mbedAustin 0:26a3a6edbb11 7 while (true) {
mbedAustin 0:26a3a6edbb11 8 value = sensorUV;
mbedAustin 0:26a3a6edbb11 9 printf("\rUV Value = %3.2f%%",value*100);
mbedAustin 0:26a3a6edbb11 10 wait(.1);
mbedAustin 0:26a3a6edbb11 11 }
mbedAustin 0:26a3a6edbb11 12 }