Julian Labuschagne / Mbed 2 deprecated Nucleo_analog_meter

Dependencies:   mbed

main.cpp

Committer:
julianlab
Date:
2015-08-15
Revision:
2:5c81e1847ccd
Parent:
1:28c8eafa0fe3

File content as of revision 2:5c81e1847ccd:

#include "mbed.h"

AnalogIn potValue(PA_0); 

BusOut leds(PA_10, PB_3, PB_5, PB_4, PB_10, PA_8, PA_9, PC_7, PB_6, PA_7);

int main() {
    
    int bitmask = 0x3ff;
    
    while(1) {
        
        int sensor_value = (int) (potValue.read() * 10);
        
        leds = ~(bitmask << sensor_value);
        
        wait(0.1);
    }
    
}