![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Exo
Diff: main.cpp
- Revision:
- 0:423cc5f68c56
diff -r 000000000000 -r 423cc5f68c56 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue May 29 14:16:00 2018 +0000 @@ -0,0 +1,34 @@ +#include "Nboard.h" + + +IHM ihm; + +int main() +{ + UINT16 val,pota,decal; + float pot; + while(1) { + BusSelMux=Ana7; + wait_us(1); + val=AnaIn.read_u16(); + pot=AnaIn.read(); + pota=val; + decal=val; + pota=pota>>4; + ihm.LCD_gotoxy(0,0); + ihm.LCD_printf("POT=%04X=%3.2f",val,pot); + ihm.LCD_gotoxy(1,0); + ihm.LCD_printf("POT=%X=%5d",pota,pota); + decal=decal>>8; + //Bus8Leds=decal; + if(pot==0.5){ + Bus8Leds=0x0F; + } + if(pot>=0.75){ + Bus8Leds=0x3F; + } + else{ + Bus8Leds=0x00; + } + } +} \ No newline at end of file