Quentin LAM
/
ex17
Exo
Diff: Nboard.cpp
- Revision:
- 12:af99168c1a11
- Parent:
- 11:7cfa7c991676
- Child:
- 14:4df60a00f825
--- a/Nboard.cpp Sat Oct 01 13:04:07 2016 +0000 +++ b/Nboard.cpp Sat Nov 05 17:20:20 2016 +0000 @@ -1,11 +1,14 @@ #include "IHM.h" -IHM ihm; -Serial pc(SERIAL_TX, SERIAL_RX); +IHM ihm; //clase IHM +Serial pc(SERIAL_TX, SERIAL_RX); // I/O terminal PC int main() { - unsigned char i=0,j; + UINT8 codeur=0,jog; float pi=4*atan(1.0); + ihm.LCD_gotoxy(0,4); pc.printf("Hello World \n"); + ihm.LCD_clear(); + ihm.LCD_gotoxy(0,4); ihm.LCD_printf("Hello World "); ihm.LCD_gotoxy(1,0); ihm.LCD_printf("PI= %f",pi); // test affichage float @@ -18,13 +21,13 @@ ihm.LCD_clear(); while(1) { wait(0.1); - i=ihm.COD_read(); - j=ihm.JOG_read(); - ihm.BAR_set((UINT16)(i)); + codeur=ihm.COD_read(); + jog=ihm.JOG_read(); + ihm.BAR_set((UINT16)(codeur)); ihm.LCD_gotoxy(0,0); - ihm.LCD_printf("Jog=%02d",j); + ihm.LCD_printf("Jog=%02d",jog); ihm.LCD_gotoxy(1,0); - ihm.LCD_printf("Cod=%03d",i); - pc.printf("Jog=%02d Cod=%03d \n",j,i); + ihm.LCD_printf("Cod=%03d",codeur); + pc.printf("Jog=%02d Cod=%03d \n",jog,codeur); } }