12.07.2015 Views

Programming Manual Elektor Proton Robot - ELEKTOR.se

Programming Manual Elektor Proton Robot - ELEKTOR.se

Programming Manual Elektor Proton Robot - ELEKTOR.se

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

}}// Writes an integer value to the LCD (16bit)void LCD03_WRITE_INT(int ii){unsigned char j,jj,jjj,jjjj,jjjjj;j=((ii/10000) % 10)+48; // ? x 10000jj=((ii/1000) % 10)+48; // ? x 1000jjj=((ii/100) % 10)+48; // ? x 100jjjj=((ii/10) % 10)+48; // ? x 10jjjjj=(ii % 10)+48; // ? x 1if (j==48) I2C_SEND_MESSAGE(0xC6,0,32); // space if number does not existel<strong>se</strong> I2C_SEND_MESSAGE(0xC6,0,j); // Write to LCD (48 is the ASCII off<strong>se</strong>t)if ((jj==48)&(j==48)) I2C_SEND_MESSAGE(0xC6,0,32);el<strong>se</strong> I2C_SEND_MESSAGE(0xC6,0,jj); //putch(48+jj);if ((jjj==48)&(jj==48)) I2C_SEND_MESSAGE(0xC6,0,32);el<strong>se</strong> I2C_SEND_MESSAGE(0xC6,0,jjj);if ((jjjj==48)&(jjj==48)) I2C_SEND_MESSAGE(0xC6,0,32);el<strong>se</strong> I2C_SEND_MESSAGE(0xC6,0,jjjj);}I2C_SEND_MESSAGE(0xC6,0,jjjjj);// Writes a BYTE value to the LCD (8bit)void LCD03_WRITE_BYTE(char ii){unsigned char jj,jjj,jjjj;jj=((ii/100) % 10)+48; // ? x 100jjj=((ii/10) % 10)+48; // ? x 10jjjj=(ii % 10)+48; // ? x 1if ((jj==48)) I2C_SEND_MESSAGE(0xC6,0,32);el<strong>se</strong> I2C_SEND_MESSAGE(0xC6,0,jj); //putch(48+jj);if ((jjj==48)&(jj==48)) I2C_SEND_MESSAGE(0xC6,0,32);el<strong>se</strong> I2C_SEND_MESSAGE(0xC6,0,jjj); //putch(48+jjj);}I2C_SEND_MESSAGE(0xC6,0,jjjj); //putch(48+jjjj);//Clears a single line (LIne 0-1-2-3)void LCD03_CLEAR_LINE(char line) // line 0-1-2-3{char cursor;cursor = line *20;LCD03_SET_CURSOR(cursor);LCD_WRITE_STRING(""); //20 x space}/*************************************************************************STRING FUNCTIONS - STRING FUNCTIONS - STRING FUNCTIONS - STRING FUNCTIONS**************************************************************************/Bart Huyskens <strong>Manual</strong> <strong>Elektor</strong> <strong>Proton</strong> V1.0 3 April 2011 155

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!