Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- extern void writePoint3x3 (byte x, byte y, byte color);
- extern void writeString(byte x, byte y, char string[]);
- void tpCalibrate(byte *cal_x_min, byte *cal_y_min, byte *cal_x_max, byte *cal_y_max)
- {
- static const char inf_esq[] = "Extrem inferior esquerra";
- static const char sup_dre[] = "Extrem superior dret";
- while (!tpPressDetect()) {
- clearGLCD(7, 7, 0, 127);
- writeString(3, 0, (char *)inf_esq);
- writePoint3x3(64, 0, 1);
- __delay_ms(10);
- }
- *cal_x_min = tpGetX();
- __delay_ms(1);
- *cal_y_min = tpGetY();
- while (tpPressDetect()) {
- __delay_ms(10);
- }
- while (!tpPressDetect()) {
- clearGLCD(7, 7, 0, 127);
- writeString(3, 0, (char *)sup_dre);
- writePoint3x3(0, 125, 1);
- __delay_ms(10);
- }
- *cal_x_max = tpGetX();
- __delay_ms(1);
- *cal_y_max = tpGetY();
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement