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 Motoo Tanaka

/media/uploads/trevieze/win_20170427_21_31_20_pro.jpg

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.

Committer:
trevieze
Date:
Sat Dec 17 18:55:31 2016 +0000
Revision:
2:c5085faf2aa5
Child:
4:25554dc066a0
Touch pad library is working.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
trevieze 2:c5085faf2aa5 1 /* mbed library for touchscreen connected to 4 mbed pins
trevieze 2:c5085faf2aa5 2 * derive from SPI_TFT lib
trevieze 2:c5085faf2aa5 3 * Copyright (c) 2011 Peter Drescher - DC2PD
trevieze 2:c5085faf2aa5 4 *
trevieze 2:c5085faf2aa5 5 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
trevieze 2:c5085faf2aa5 6 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
trevieze 2:c5085faf2aa5 7 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
trevieze 2:c5085faf2aa5 8 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
trevieze 2:c5085faf2aa5 9 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
trevieze 2:c5085faf2aa5 10 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
trevieze 2:c5085faf2aa5 11 * THE SOFTWARE.
trevieze 2:c5085faf2aa5 12 */
trevieze 2:c5085faf2aa5 13
trevieze 2:c5085faf2aa5 14 #ifndef MBED_TOUCH_H
trevieze 2:c5085faf2aa5 15 #define MBED_TOUCH_H
trevieze 2:c5085faf2aa5 16
trevieze 2:c5085faf2aa5 17 #include "mbed.h"
trevieze 2:c5085faf2aa5 18
trevieze 2:c5085faf2aa5 19 #define __PRESURE 29000
trevieze 2:c5085faf2aa5 20 #define RXPLATE 300
trevieze 2:c5085faf2aa5 21
trevieze 2:c5085faf2aa5 22 struct point {
trevieze 2:c5085faf2aa5 23 int x;
trevieze 2:c5085faf2aa5 24 int y;
trevieze 2:c5085faf2aa5 25 int z;
trevieze 2:c5085faf2aa5 26 };
trevieze 2:c5085faf2aa5 27
trevieze 2:c5085faf2aa5 28 class TouchScreen {
trevieze 2:c5085faf2aa5 29 public:
trevieze 2:c5085faf2aa5 30 /** create a TFT with touch object connected to the pins:
trevieze 2:c5085faf2aa5 31 *
trevieze 2:c5085faf2aa5 32 * @param pin xp resistiv touch x+
trevieze 2:c5085faf2aa5 33 * @param pin xm resistiv touch x-
trevieze 2:c5085faf2aa5 34 * @param pin yp resistiv touch y+
trevieze 2:c5085faf2aa5 35 * @param pin ym resistiv touch y-
trevieze 2:c5085faf2aa5 36 * @param mosi,miso,sclk SPI connection to TFT
trevieze 2:c5085faf2aa5 37 * @param cs pin connected to CS of display
trevieze 2:c5085faf2aa5 38 * @param reset pin connected to RESET of display
trevieze 2:c5085faf2aa5 39 * based on my SPI_TFT lib
trevieze 2:c5085faf2aa5 40 */
trevieze 2:c5085faf2aa5 41 TouchScreen(PinName xp, PinName xm, PinName yp, PinName ym);
trevieze 2:c5085faf2aa5 42 void getTouch(point& p);
trevieze 2:c5085faf2aa5 43 protected:
trevieze 2:c5085faf2aa5 44 PinName _xm;
trevieze 2:c5085faf2aa5 45 PinName _ym;
trevieze 2:c5085faf2aa5 46 PinName _xp;
trevieze 2:c5085faf2aa5 47 PinName _yp;
trevieze 2:c5085faf2aa5 48 //DigitalOut bl;
trevieze 2:c5085faf2aa5 49
trevieze 2:c5085faf2aa5 50 typedef enum { YES, MAYBE, NO } TOUCH;
trevieze 2:c5085faf2aa5 51 int readTouch(PinName p, PinName m, PinName a, PinName i);
trevieze 2:c5085faf2aa5 52
trevieze 2:c5085faf2aa5 53 int x_off,y_off;
trevieze 2:c5085faf2aa5 54 int pp_tx,pp_ty;
trevieze 2:c5085faf2aa5 55 };
trevieze 2:c5085faf2aa5 56
trevieze 2:c5085faf2aa5 57 #endif