Contains the main execution of the clock uses headers to import functions
Dependencies: RTC-DS1307 SPI_TFT_ILI9341 TFT_fonts mbed tsi_sensor
Fork of TFT_Mikroelectronika_IL9341_sketchpad by
Diff: poll.h
- Revision:
- 31:3255668e6b08
- Parent:
- 13:e74e09de81e4
- Child:
- 40:05798eeadd02
diff -r af38c80391cb -r 3255668e6b08 poll.h --- a/poll.h Thu May 25 13:24:26 2017 +0000 +++ b/poll.h Thu May 25 15:32:20 2017 +0000 @@ -1,4 +1,8 @@ #include "stdio.h" +#define PinXm A1 +#define PinXp A0 +#define PinYm A3 +#define PinYp A2 #include "SPI_TFT_ILI9341.h" @@ -17,7 +21,7 @@ // the TFT is connected to SPI pin 5-7 //SPI_TFT_ILI9341 TFT(p5, p6, p7, p8, p9, p10,"TFT"); // mosi, miso, sclk, cs, reset, dc for lpc1768 -SPI_TFT_ILI9341 TFT(PTD6, PTD7, PTD5, PTD2, PTD4, PTA13, "TFT"); // mosi, miso, sclk, cs, reset, dc for frdmkl25z +SPI_TFT_ILI9341 TFT(PTA16, PTA17, PTA15, PTD2, PTD4, PTA13, "TFT"); // mosi, miso, sclk, cs, reset, dc for frdmkl25z //NB better combination to use a coherent 2x4 block for lcd // SPI_TFT_ILI9341 TFT(PTD2, PTD3, PTD1, PTA16, PTA17, PTC16,"TFT"); // mosi, miso, sclk, cs, reset, dc for frdmkl25z // DigitalOut LCD_LED(PTC17); @@ -36,10 +40,10 @@ int delta = 0, xv1 = 0, xv2 = 0, k = 0; int temp1 = 0, temp2 = 0; - AnalogIn yp(PTB3); - AnalogIn ym(PTB2); - DigitalOut xp(PTB0); - DigitalOut xm(PTB1); + AnalogIn yp(PinYp); + AnalogIn ym(PinYm); + DigitalOut xp(PinXp); + DigitalOut xm(PinXm); xp = 1; // set positive side of x high xm = 0; @@ -69,10 +73,10 @@ // subroutine to read y values - has different pin functions .. int readX() { - DigitalOut yp(PTB3); - DigitalOut ym(PTB2); - AnalogIn xp(PTB0); - AnalogIn xm(PTB1); + DigitalOut yp(PinYp); + DigitalOut ym(PinYm); + AnalogIn xp(PinXp); + AnalogIn xm(PinXm); int delta = 0, yv1 = 0, yv2 = 0, k = 0; int temp1 = 0, temp2 = 0; yp = 1; // set positive sdie of x high @@ -93,7 +97,7 @@ //pc.printf("yval=%d",yval); yp = 0; ym = 0; - return (320 - (320 * ((yv2) / 1 / 10 - 3000)) / 58300); // returns Y + return ((320 * ((yv2) / 1 / 10 - 3000)) / 58300); // returns X // return(yval); }