ok

Dependencies:   mbed

Committer:
DeanArm7
Date:
Tue Nov 28 00:08:45 2017 +0000
Revision:
0:0302f3c057c9
Child:
1:0260e05c8e83
ok

Who changed what in which revision?

UserRevisionLine numberNew contents of line
DeanArm7 0:0302f3c057c9 1 #include "mbed.h"
DeanArm7 0:0302f3c057c9 2
DeanArm7 0:0302f3c057c9 3 DigitalOut myled1(LED1);
DeanArm7 0:0302f3c057c9 4 DigitalOut myled2(LED2);
DeanArm7 0:0302f3c057c9 5
DeanArm7 0:0302f3c057c9 6 AnalogIn tempin(p17);
DeanArm7 0:0302f3c057c9 7
DeanArm7 0:0302f3c057c9 8 int main() {
DeanArm7 0:0302f3c057c9 9 myled1 = 0;
DeanArm7 0:0302f3c057c9 10 myled2 = 0;
DeanArm7 0:0302f3c057c9 11
DeanArm7 0:0302f3c057c9 12 while(1) {
DeanArm7 0:0302f3c057c9 13 wait(0.5);
DeanArm7 0:0302f3c057c9 14 if(tempin > 0.34f){ //going above 1.07V
DeanArm7 0:0302f3c057c9 15 myled1 = 0;
DeanArm7 0:0302f3c057c9 16 myled2 = 1;
DeanArm7 0:0302f3c057c9 17 }
DeanArm7 0:0302f3c057c9 18 if(tempin < 0.34f){ //going below 1.07V
DeanArm7 0:0302f3c057c9 19 myled1 = 1;
DeanArm7 0:0302f3c057c9 20 myled2 = 0;
DeanArm7 0:0302f3c057c9 21 }
DeanArm7 0:0302f3c057c9 22 }
DeanArm7 0:0302f3c057c9 23 }