This is a fork of a functional ILI9341 display with a functional Seeed touch screen library.
Dependencies: BMP180 UniGraphic mbed BNO055_fusionI_fixed HTU21D GPSISR Compass Fonts uGUI
Fork of TFT_test_NUCLEO-F411RE by
Had to move sensors to a remote board because of interference. Added spi burst mode to supported displays.
To do.... ugui buttons are slow. will need to add rtos to project. Finish other way points screen. Will have to rewrite portions of the touch screen class. Sense touch, delay, read values and then average, touch released, is the sequence. Add cadence input and logic to program for computer screen.
Revision 22:39a8e5c47f3c, committed 2018-05-18
- Comitter:
- trevieze
- Date:
- Fri May 18 18:26:36 2018 +0000
- Parent:
- 21:39ef2fd5c4bf
- Commit message:
- Working on touch screen response. Loading new uGui class for a test drive.
Changed in this revision
SeeedStudioTFTv2.cpp | Show annotated file Show diff for this revision Revisions of this file |
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 39ef2fd5c4bf -r 39a8e5c47f3c SeeedStudioTFTv2.cpp --- a/SeeedStudioTFTv2.cpp Wed May 16 18:50:19 2018 +0000 +++ b/SeeedStudioTFTv2.cpp Fri May 18 18:26:36 2018 +0000 @@ -48,7 +48,6 @@ // Put averaging solution here. Take n samples then average. n=5000; for (int j=0; i<n; j++) { - avg = avg + _a.read_u16(); } avg=avg/n; @@ -78,6 +77,8 @@ rtouch = z2; rtouch /= z1; rtouch -= 1; + //Constants from origional reference. + //12 bit ADC rtouch *= (4094-p.x)/2; rtouch *= RXPLATE; rtouch /= 2048;
diff -r 39ef2fd5c4bf -r 39a8e5c47f3c main.cpp --- a/main.cpp Wed May 16 18:50:19 2018 +0000 +++ b/main.cpp Fri May 18 18:26:36 2018 +0000 @@ -254,7 +254,7 @@ } pageinit = 1; if (bmp180.init() != 0) { - //pc.printf("Error communicating with BMP180\n"); + //pc.printf("Error communicating with BMP180\n"); } else { //pc.printf("Initialized BMP180\n"); bmp180.startTemperature(); @@ -320,7 +320,7 @@ } break; } - //This is screen two of bike computer. It is executed every 2 seconds. Ie...refresh_Time + //This is screen two of bike computer. It is executed every 2 seconds. Ie...refresh_Time case PAGE2: { if (!pageinit) { UG_WindowHide(&window_1); @@ -330,6 +330,7 @@ TFT.drawXBitmap(20,35,compass,compass_width,compass_height,C_WHITE); } pageinit = 1; + // Need to fix this. Documentation states that this is bitwise status. if (imu.read_calib_status() > 0x0) { imu.get_Euler_Angles(&euler_angles); float angle = euler_angles.h; // Convert radians to degrees for more a more usual result @@ -366,7 +367,7 @@ } } - /* + /* Add Nav back onto screen 3 TFT.locate(140, 260) ; TFT.printf("%.1fft", MyGPS.buffer.altitude/0.3048); TFT.locate(4, 280) ; @@ -425,7 +426,7 @@ void arrow(int x2, int y2, int x1, int y1, int alength, int awidth, int colour) { float distance; - int dx, dy, x2o,y2o,x3,y3,x4,y4,k; + int dx, dy, x2o, y2o, x3, y3, x4, y4, k; distance = sqrt(pow((double)(x1 - x2),2) + pow((double)(y1 - y2), 2)); dx = x2 + (x1 - x2) * alength / distance; dy = y2 + (y1 - y2) * alength / distance;