exemple d'utilisation de l'IHM NBOARD (IUT Cachan).

Dependencies:   IHM_NBOARD mbed

Nboard.cpp

Committer:
gr66
Date:
2016-10-01
Revision:
11:7cfa7c991676
Parent:
10:4c838a5a5e42
Child:
12:af99168c1a11

File content as of revision 11:7cfa7c991676:

#include "IHM.h"
IHM ihm;
Serial pc(SERIAL_TX, SERIAL_RX);
int main()
{
    unsigned char i=0,j;
    float pi=4*atan(1.0);
    pc.printf("Hello World  \n");
    ihm.LCD_printf("Hello World      ");
    ihm.LCD_gotoxy(1,0);
    ihm.LCD_printf("PI= %f",pi);  // test affichage float
    ihm.BAR_set(0x3FF);
    wait(2);
    ihm.BAR_set(0x2AA);
    wait(2);
    ihm.BAR_set(0x155);
    wait(2);
    ihm.LCD_clear();
    while(1) {
        wait(0.1);
        i=ihm.COD_read();      
        j=ihm.JOG_read();
        ihm.BAR_set((UINT16)(i));
        ihm.LCD_gotoxy(0,0);
        ihm.LCD_printf("Jog=%02d",j);
        ihm.LCD_gotoxy(1,0);
        ihm.LCD_printf("Cod=%03d",i);
        pc.printf("Jog=%02d  Cod=%03d \n",j,i); 
    }
}