Prüfung 9.06.2016

Dependencies:   mbed

Fork of 3BHEL_LDR1 by BULME_BHEL18

main.cpp

Committer:
PosztosAlex
Date:
2016-06-09
Revision:
1:987bbbdbcedf
Parent:
0:4a51d86e4cbd

File content as of revision 1:987bbbdbcedf:

#include "mbed.h"

AnalogIn POTI(p15);
BusOut myled(P1_13,P1_12,P1_7,P1_6,P1_4,P1_3,P1_1,P1_0,LED4,LED3,LED2,LED1);

Serial pc(USBTX,USBRX);

int main() {
    while(1) {
       
       pc.printf(" %f\n",  POTI.read());
       
       
       int poti= POTI.read() *10;    
       
       myled = 0;
       for(int i = 0 ;i < poti ; i++ )
        {   
            myled = 0b1<<i ; 
        }       
        wait_ms(10);   
    }
}