ECE 4180 / Mbed 2 deprecated 4180-L2-P7

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002  
00003  PwmOut ctrl(p21);
00004 PwmOut myled(LED1);
00005  
00006 int main() {
00007 
00008     while(1){
00009         
00010         for(float p = 0.0f; p < 1.0f; p += 0.1f) {
00011             myled = p; //dim led using PWM
00012             ctrl = p;
00013             wait(0.5); //0.1 second time delay-so a human can see it
00014         }
00015         
00016     }
00017     
00018 }