Prog Demo Version Mai 2018

Dependencies:   IHM_V2 mbed

Fork of NBoard_IHM_V2 by NBoard

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Nboard_IHM.cpp Source File

Nboard_IHM.cpp

00001 #include "IHM.h"
00002 IHM ihm;  //clase IHM
00003 Serial pc(USBTX, USBRX);  // I/O terminal PC 
00004 int main()
00005 {
00006     UINT8 codeur=0,jog;
00007     float pi=4*atan(1.0);
00008     ihm.LCD_gotoxy(0,1);
00009     pc.printf("Hello IHMV1 \n");
00010     ihm.LCD_clear();
00011     ihm.LCD_gotoxy(0,0);
00012     ihm.LCD_printf("Hello IHM V1");
00013     ihm.LCD_gotoxy(1,0);
00014     ihm.LCD_printf("PI= %f",pi);  // test affichage float
00015     ihm.BAR_set(0x3FF);
00016     wait(2);
00017     ihm.BAR_set(0x2AA);
00018     wait(2);
00019     ihm.BAR_set(0x155);
00020     wait(2);
00021     ihm.LCD_clear();
00022     while(1) {
00023         wait(0.5);
00024         codeur=ihm.COD_read();      
00025         jog=ihm.JOG_read();
00026         ihm.BAR_set((UINT16)(codeur));
00027         ihm.LCD_gotoxy(0,0);
00028         ihm.LCD_printf("Jog=%02d",jog);
00029         ihm.LCD_gotoxy(1,0);
00030         ihm.LCD_printf("Cod=%03d",codeur);
00031         pc.printf("Jog=%02d  Cod=%03d \n",jog,codeur); 
00032     }
00033 }