![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Exo
main.cpp
- Committer:
- Quent1nl
- Date:
- 2018-05-29
- Revision:
- 0:423cc5f68c56
File content as of revision 0:423cc5f68c56:
#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; } } }