Prüfung 9.06.2016

Dependencies:   mbed

Fork of 3BHEL_LDR1 by BULME_BHEL18

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 
00003 AnalogIn POTI(p15);
00004 BusOut myled(P1_13,P1_12,P1_7,P1_6,P1_4,P1_3,P1_1,P1_0,LED4,LED3,LED2,LED1);
00005 
00006 Serial pc(USBTX,USBRX);
00007 
00008 int main() {
00009     while(1) {
00010        
00011        pc.printf(" %f\n",  POTI.read());
00012        
00013        
00014        int poti= POTI.read() *10;    
00015        
00016        myled = 0;
00017        for(int i = 0 ;i < poti ; i++ )
00018         {   
00019             myled = 0b1<<i ; 
00020         }       
00021         wait_ms(10);   
00022     }
00023 }