├── IC Tester Manual.pdf ├── libraries ├── Adafruit libraries │ ├── Adafruit_GFX_Library │ │ ├── .gitignore │ │ ├── fontconvert │ │ │ ├── Makefile │ │ │ ├── makefonts.sh │ │ │ └── fontconvert_win.md │ │ ├── library.properties │ │ ├── gfxfont.h │ │ ├── license.txt │ │ ├── README.md │ │ ├── Adafruit_SPITFT.h │ │ └── Adafruit_SPITFT_Macros.h │ ├── Adafruit_TFTLCD │ │ ├── bitmaps │ │ │ ├── Thumbs.db │ │ │ ├── test.bmp │ │ │ ├── woof.bmp │ │ │ └── miniwoof.bmp │ │ ├── README.txt │ │ ├── Adafruit_TFTLCD.h │ │ ├── registers.h │ │ └── examples │ │ │ └── tftpaint_shield │ │ │ └── tftpaint_shield.ino │ ├── README.md │ └── TouchScreen │ │ ├── README.txt │ │ ├── TouchScreen.h │ │ ├── examples │ │ ├── touchscreendemo │ │ │ └── touchscreendemo.pde │ │ └── touchscreendemoshield │ │ │ └── touchscreendemoshield.ino │ │ └── TouchScreen.cpp ├── SPFD5408 libraries │ ├── README.md │ ├── SPFD5408 │ │ ├── lib.index │ │ ├── bitmaps │ │ │ ├── test.bmp │ │ │ ├── woof.bmp │ │ │ └── miniwoof.bmp │ │ ├── PINOUT_SD.txt │ │ ├── SPFD5408_Util.h │ │ ├── fontconvert │ │ │ ├── Makefile │ │ │ ├── makefonts.sh │ │ │ ├── fontconvert_win.md │ │ │ └── bdf2adafruit.py │ │ ├── SPFD5408_Util.cpp │ │ ├── adafruit_docs │ │ │ ├── README_ADAFRUIT_TOUCHSCREEN.txt │ │ │ ├── README_ADAFRUIT_TFTLCD.txt │ │ │ ├── license.txt │ │ │ └── README_ADAFRUIT_GFX.txt │ │ ├── gfx.library.properties │ │ ├── SPFD5408_TouchScreen.h │ │ ├── LICENSE │ │ ├── license.txt │ │ ├── examples │ │ │ ├── spfd5408_tftgrid │ │ │ │ └── spfd5408_tftgrid.ino │ │ │ └── adafruit_originals │ │ │ │ └── tftpaint_shield │ │ │ │ ├── tftpaint_shield.ino │ │ │ │ └── tftpaint_shield.pde │ │ ├── SPFD5408_Adafruit_GFX.h │ │ ├── SPFD5408_Adafruit_TFTLCD.h │ │ ├── registers.h │ │ ├── Fonts │ │ │ └── Tiny3x3a2pt7b.h │ │ ├── SPFD5408_TouchScreen.cpp │ │ └── README.md │ └── SPFD5408_TFT_Library │ │ ├── bitmaps │ │ ├── test.bmp │ │ ├── woof.bmp │ │ └── miniwoof.bmp │ │ ├── library.properties │ │ ├── README.txt │ │ ├── src │ │ ├── TftSpfd5408.h │ │ └── registers.h │ │ └── examples │ │ ├── tftpaint_shield │ │ └── tftpaint_shield.ino │ │ ├── rotationtest │ │ └── rotationtest.pde │ │ └── tftpaint │ │ └── tftpaint.ino ├── Kicksort library │ ├── README.md │ └── KickSort │ │ ├── extras │ │ └── references │ │ │ └── robtillaart_sorting_algorithms.pdf │ │ ├── README.md │ │ ├── library.properties │ │ ├── keywords.txt │ │ └── examples │ │ ├── EXAMPLE04_CombSort │ │ └── EXAMPLE04_CombSort.ino │ │ ├── EXAMPLE05_ShellSort │ │ └── EXAMPLE05_ShellSort.ino │ │ ├── EXAMPLE02_BubbleSort │ │ └── EXAMPLE02_BubbleSort.ino │ │ ├── EXAMPLE03_InsertionSort │ │ └── EXAMPLE03_InsertionSort.ino │ │ └── EXAMPLE01_QuickSort │ │ └── EXAMPLE01_QuickSort.ino ├── SD library │ ├── README.md │ └── SD │ │ ├── README.txt │ │ ├── keywords.txt │ │ ├── .github │ │ ├── PULL_REQUEST_TEMPLATE.md │ │ └── ISSUE_TEMPLATE.md │ │ ├── examples │ │ ├── DumpFile │ │ │ └── DumpFile.ino │ │ ├── Files │ │ │ └── Files.ino │ │ ├── ReadWrite │ │ │ └── ReadWrite.ino │ │ ├── listfiles │ │ │ └── listfiles.ino │ │ ├── Datalogger │ │ │ └── Datalogger.ino │ │ └── CardInfo │ │ │ └── CardInfo.ino │ │ ├── utility │ │ └── SdFatUtil.h │ │ ├── File.cpp │ │ └── SD.h └── README.md ├── LICENSE ├── README.md └── IC_Tester ├── Test_Functions.ino └── IC_search.ino /IC Tester Manual.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4516N41/IC-Tester/HEAD/IC Tester Manual.pdf -------------------------------------------------------------------------------- /libraries/Adafruit libraries/Adafruit_GFX_Library/.gitignore: -------------------------------------------------------------------------------- 1 | default.vim 2 | fontconvert/fontconvert 3 | -------------------------------------------------------------------------------- /libraries/SPFD5408 libraries/README.md: -------------------------------------------------------------------------------- 1 | This is the library that I had to use for my screens. 2 | 3 | https://github.com/JoaoLopesF/SPFD5408 4 | -------------------------------------------------------------------------------- /libraries/SPFD5408 libraries/SPFD5408/lib.index: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4516N41/IC-Tester/HEAD/libraries/SPFD5408 libraries/SPFD5408/lib.index -------------------------------------------------------------------------------- /libraries/Kicksort library/README.md: -------------------------------------------------------------------------------- 1 | The alphabetical sorting library used with the IC tester. Put it in your libraries folder Documents/Arduino/libraries 2 | -------------------------------------------------------------------------------- /libraries/SPFD5408 libraries/SPFD5408/bitmaps/test.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4516N41/IC-Tester/HEAD/libraries/SPFD5408 libraries/SPFD5408/bitmaps/test.bmp -------------------------------------------------------------------------------- /libraries/SPFD5408 libraries/SPFD5408/bitmaps/woof.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4516N41/IC-Tester/HEAD/libraries/SPFD5408 libraries/SPFD5408/bitmaps/woof.bmp -------------------------------------------------------------------------------- /libraries/SPFD5408 libraries/SPFD5408/bitmaps/miniwoof.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4516N41/IC-Tester/HEAD/libraries/SPFD5408 libraries/SPFD5408/bitmaps/miniwoof.bmp -------------------------------------------------------------------------------- /libraries/Adafruit libraries/Adafruit_TFTLCD/bitmaps/Thumbs.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4516N41/IC-Tester/HEAD/libraries/Adafruit libraries/Adafruit_TFTLCD/bitmaps/Thumbs.db -------------------------------------------------------------------------------- /libraries/Adafruit libraries/Adafruit_TFTLCD/bitmaps/test.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4516N41/IC-Tester/HEAD/libraries/Adafruit libraries/Adafruit_TFTLCD/bitmaps/test.bmp -------------------------------------------------------------------------------- /libraries/Adafruit libraries/Adafruit_TFTLCD/bitmaps/woof.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4516N41/IC-Tester/HEAD/libraries/Adafruit libraries/Adafruit_TFTLCD/bitmaps/woof.bmp -------------------------------------------------------------------------------- /libraries/Adafruit libraries/Adafruit_TFTLCD/bitmaps/miniwoof.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4516N41/IC-Tester/HEAD/libraries/Adafruit libraries/Adafruit_TFTLCD/bitmaps/miniwoof.bmp -------------------------------------------------------------------------------- /libraries/SPFD5408 libraries/SPFD5408_TFT_Library/bitmaps/test.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4516N41/IC-Tester/HEAD/libraries/SPFD5408 libraries/SPFD5408_TFT_Library/bitmaps/test.bmp -------------------------------------------------------------------------------- /libraries/SPFD5408 libraries/SPFD5408_TFT_Library/bitmaps/woof.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4516N41/IC-Tester/HEAD/libraries/SPFD5408 libraries/SPFD5408_TFT_Library/bitmaps/woof.bmp -------------------------------------------------------------------------------- /libraries/SPFD5408 libraries/SPFD5408_TFT_Library/bitmaps/miniwoof.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4516N41/IC-Tester/HEAD/libraries/SPFD5408 libraries/SPFD5408_TFT_Library/bitmaps/miniwoof.bmp -------------------------------------------------------------------------------- /libraries/Adafruit libraries/README.md: -------------------------------------------------------------------------------- 1 | This is the Adafruit library that the original coder used and can be found in his gitHub. 2 | 3 | https://github.com/akshaybaweja/Smart-IC-Tester/tree/master/Libraries 4 | -------------------------------------------------------------------------------- /libraries/SPFD5408 libraries/SPFD5408/PINOUT_SD.txt: -------------------------------------------------------------------------------- 1 | Arduino MEGA 2 | 3 | 10 - SD_SS 53 CS 4 | 11 - SD-D1 51 MOSI 5 | 12 - SD_D0 50 MISO 6 | 13 - SD_SCK 52 CLK 7 | -------------------------------------------------------------------------------- /libraries/Kicksort library/KickSort/extras/references/robtillaart_sorting_algorithms.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4516N41/IC-Tester/HEAD/libraries/Kicksort library/KickSort/extras/references/robtillaart_sorting_algorithms.pdf -------------------------------------------------------------------------------- /libraries/SPFD5408 libraries/SPFD5408/SPFD5408_Util.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////// 2 | // Library: SPFD5408 Library 3 | // File: SPFD5408_Util.h 4 | /////////////////////////////////// 5 | 6 | #ifndef _SPFD5408_UTIL_H_ 7 | #define _SPFD5408_UTIL_H_ 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /libraries/SD library/README.md: -------------------------------------------------------------------------------- 1 | This library needs to be referenced to directly or you need to override the one that comes with the arduino IDE. Placing it into you library folder in documents isn't enough!!! 2 | 3 | for Arduino IDE 2 on Windows 10 it can be found here **Users\UserName\AppData\Local\Arduino15\libraries** 4 | -------------------------------------------------------------------------------- /libraries/SPFD5408 libraries/SPFD5408/fontconvert/Makefile: -------------------------------------------------------------------------------- 1 | all: fontconvert 2 | 3 | CC = gcc 4 | CFLAGS = -Wall -I/usr/local/include/freetype2 -I/usr/include/freetype2 -I/usr/include 5 | LIBS = -lfreetype 6 | 7 | fontconvert: fontconvert.c 8 | $(CC) $(CFLAGS) $< $(LIBS) -o $@ 9 | strip $@ 10 | 11 | clean: 12 | rm -f fontconvert 13 | -------------------------------------------------------------------------------- /libraries/Adafruit libraries/Adafruit_GFX_Library/fontconvert/Makefile: -------------------------------------------------------------------------------- 1 | all: fontconvert 2 | 3 | CC = gcc 4 | CFLAGS = -Wall -I/usr/local/include/freetype2 -I/usr/include/freetype2 -I/usr/include 5 | LIBS = -lfreetype 6 | 7 | fontconvert: fontconvert.c 8 | $(CC) $(CFLAGS) $< $(LIBS) -o $@ 9 | strip $@ 10 | 11 | clean: 12 | rm -f fontconvert 13 | -------------------------------------------------------------------------------- /libraries/Adafruit libraries/TouchScreen/README.txt: -------------------------------------------------------------------------------- 1 | This is the 4-wire resistive touch screen firmware for Arduino. Works with all Arduinos and the Mega 2 | 3 | 4 | To install, click DOWNLOAD SOURCE in the top right corner, and rename the uncompressed folder "TouchScreen". See our tutorial at http://www.ladyada.net/library/arduino/libraries.html on Arduino Library installation -------------------------------------------------------------------------------- /libraries/Kicksort library/KickSort/README.md: -------------------------------------------------------------------------------- 1 | # KickSort 2 | Arduino library for different sorting algorithms including quicksort, bubble sort, insertion sort, shell sort, and comb sort. 3 | 4 | This library is built from aggregating and modifying different sorting implementations from various other GitHub users including: robtillaart, emilv, luisllamasbinaburo, and dndubins. Thanks! 5 | -------------------------------------------------------------------------------- /libraries/SPFD5408 libraries/SPFD5408/SPFD5408_Util.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////// 2 | // Library: SPFD5408 Library 3 | // File: SPFD5408_Util.cpp 4 | // Author: Joao Lopes 5 | // Comments: Some utilities for TFTLCD 6 | // Versions: 7 | // 0.8 First beta - July 15 8 | /////////////////////////////////// 9 | 10 | #include "Arduino.h" 11 | #include "SPFD5408_Util.h" 12 | -------------------------------------------------------------------------------- /libraries/SPFD5408 libraries/SPFD5408_TFT_Library/library.properties: -------------------------------------------------------------------------------- 1 | name=SPFD5408 TFT Library 2 | version=1.1.0 3 | author=Sadika Sumanapala 4 | maintainer=Sadika Sumanapala 5 | sentence=TFT library for SPFD5408 6 | paragraph=This library requires Adafruit GFX Library. 7 | category=Display 8 | url=https://github.com/sadika9/TFTLCD-SPFD5408 9 | architectures=* 10 | includes=TftSpfd5408.h 11 | -------------------------------------------------------------------------------- /libraries/SPFD5408 libraries/SPFD5408/adafruit_docs/README_ADAFRUIT_TOUCHSCREEN.txt: -------------------------------------------------------------------------------- 1 | This is the 4-wire resistive touch screen firmware for Arduino. Works with all Arduinos and the Mega 2 | 3 | 4 | To install, click DOWNLOAD SOURCE in the top right corner, and rename the uncompressed folder "TouchScreen". See our tutorial at http://www.ladyada.net/library/arduino/libraries.html on Arduino Library installation -------------------------------------------------------------------------------- /libraries/SPFD5408 libraries/SPFD5408/gfx.library.properties: -------------------------------------------------------------------------------- 1 | name=Adafruit GFX Library 2 | version=1.0.2 3 | author=Adafruit 4 | maintainer=Adafruit 5 | sentence=Adafruit GFX graphics core library, this is the 'core' class that all our other graphics libraries derive from. 6 | paragraph=Install this library in addition to the display library for your hardware. 7 | category=Display 8 | url=https://github.com/adafruit/Adafruit-GFX-Library 9 | architectures=* 10 | -------------------------------------------------------------------------------- /libraries/Adafruit libraries/Adafruit_GFX_Library/library.properties: -------------------------------------------------------------------------------- 1 | name=Adafruit GFX Library 2 | version=1.2.2 3 | author=Adafruit 4 | maintainer=Adafruit 5 | sentence=Adafruit GFX graphics core library, this is the 'core' class that all our other graphics libraries derive from. 6 | paragraph=Install this library in addition to the display library for your hardware. 7 | category=Display 8 | url=https://github.com/adafruit/Adafruit-GFX-Library 9 | architectures=* 10 | -------------------------------------------------------------------------------- /libraries/SD library/SD/README.txt: -------------------------------------------------------------------------------- 1 | 2 | ** SD - a slightly more friendly wrapper for sdfatlib ** 3 | 4 | This library aims to expose a subset of SD card functionality in the 5 | form of a higher level "wrapper" object. 6 | 7 | License: GNU General Public License V3 8 | (Because sdfatlib is licensed with this.) 9 | 10 | (C) Copyright 2010 SparkFun Electronics 11 | 12 | Now better than ever with optimization, multiple file support, directory handling, etc - ladyada! 13 | 14 | -------------------------------------------------------------------------------- /libraries/Kicksort library/KickSort/library.properties: -------------------------------------------------------------------------------- 1 | name=KickSort 2 | version=1.1.0 3 | author=Linnes Lab, Orlando S. Hoilett 4 | maintainer=Orlando S. Hoilett 5 | sentence=Arduino library for different sorting algorithms including quicksort, bubble sort, insertion sort, shell sort, and comb sort. 6 | paragraph=The class is templated allowing for ease of use across different data types. This library is built from aggregating and modifying different sorting implementations from various other GitHub users including: robtillaart, emilv, luisllamasbinaburo, and dndubins. Thanks! 7 | category=Data Storage 8 | url=https://github.com/LinnesLab/KickSort 9 | architectures=* 10 | 11 | -------------------------------------------------------------------------------- /libraries/Kicksort library/KickSort/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map for KickSort 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | KickSort KEYWORD1 10 | 11 | 12 | 13 | ####################################### 14 | # Methods and Functions (KEYWORD2) 15 | ####################################### 16 | 17 | bubbleSort KEYWORD2 18 | quickSort KEYWORD2 19 | insertionSort KEYWORD2 20 | shellSort KEYWORD2 21 | combSort KEYWORD2 22 | 23 | 24 | 25 | ####################################### 26 | # Constants (LITERAL1) 27 | ####################################### 28 | 29 | KickSort_Dir LITERAL1 30 | ASCENDING LITERAL1 31 | DESCENDING LITERAL1 32 | 33 | -------------------------------------------------------------------------------- /libraries/SD library/SD/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map SD 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | SD KEYWORD1 10 | File KEYWORD1 11 | 12 | ####################################### 13 | # Methods and Functions (KEYWORD2) 14 | ####################################### 15 | begin KEYWORD2 16 | exists KEYWORD2 17 | mkdir KEYWORD2 18 | remove KEYWORD2 19 | rmdir KEYWORD2 20 | open KEYWORD2 21 | close KEYWORD2 22 | seek KEYWORD2 23 | position KEYWORD2 24 | size KEYWORD2 25 | 26 | ####################################### 27 | # Constants (LITERAL1) 28 | ####################################### 29 | FILE_READ LITERAL1 30 | FILE_WRITE LITERAL1 31 | -------------------------------------------------------------------------------- /libraries/Adafruit libraries/TouchScreen/TouchScreen.h: -------------------------------------------------------------------------------- 1 | // Touch screen library with X Y and Z (pressure) readings as well 2 | // as oversampling to avoid 'bouncing' 3 | // (c) ladyada / adafruit 4 | // Code under MIT License 5 | 6 | #ifndef _ADAFRUIT_TOUCHSCREEN_H_ 7 | #define _ADAFRUIT_TOUCHSCREEN_H_ 8 | #include 9 | 10 | class TSPoint { 11 | public: 12 | TSPoint(void); 13 | TSPoint(int16_t x, int16_t y, int16_t z); 14 | 15 | bool operator==(TSPoint); 16 | bool operator!=(TSPoint); 17 | 18 | int16_t x, y, z; 19 | }; 20 | 21 | class TouchScreen { 22 | public: 23 | TouchScreen(uint8_t xp, uint8_t yp, uint8_t xm, uint8_t ym); 24 | TouchScreen(uint8_t xp, uint8_t yp, uint8_t xm, uint8_t ym, uint16_t rx); 25 | 26 | bool isTouching(void); 27 | uint16_t pressure(void); 28 | int readTouchY(); 29 | int readTouchX(); 30 | TSPoint getPoint(); 31 | int16_t pressureThreshhold; 32 | 33 | private: 34 | uint8_t _yp, _ym, _xm, _xp; 35 | uint16_t _rxplate; 36 | }; 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /libraries/SPFD5408 libraries/SPFD5408/SPFD5408_TouchScreen.h: -------------------------------------------------------------------------------- 1 | // Touch screen library with X Y and Z (pressure) readings as well 2 | // as oversampling to avoid 'bouncing' 3 | // (c) ladyada / adafruit 4 | // Code under MIT License 5 | 6 | #ifndef _ADAFRUIT_TOUCHSCREEN_H_ 7 | #define _ADAFRUIT_TOUCHSCREEN_H_ 8 | #include 9 | 10 | class TSPoint { 11 | public: 12 | TSPoint(void); 13 | TSPoint(int16_t x, int16_t y, int16_t z); 14 | 15 | bool operator==(TSPoint); 16 | bool operator!=(TSPoint); 17 | 18 | int16_t x, y, z; 19 | }; 20 | 21 | class TouchScreen { 22 | public: 23 | TouchScreen(uint8_t xp, uint8_t yp, uint8_t xm, uint8_t ym); 24 | TouchScreen(uint8_t xp, uint8_t yp, uint8_t xm, uint8_t ym, uint16_t rx); 25 | 26 | bool isTouching(void); 27 | uint16_t pressure(void); 28 | int readTouchY(); 29 | int readTouchX(); 30 | TSPoint getPoint(); 31 | int16_t pressureThreshhold; 32 | 33 | private: 34 | uint8_t _yp, _ym, _xm, _xp; 35 | uint16_t _rxplate; 36 | }; 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /libraries/Adafruit libraries/Adafruit_GFX_Library/gfxfont.h: -------------------------------------------------------------------------------- 1 | // Font structures for newer Adafruit_GFX (1.1 and later). 2 | // Example fonts are included in 'Fonts' directory. 3 | // To use a font in your Arduino sketch, #include the corresponding .h 4 | // file and pass address of GFXfont struct to setFont(). Pass NULL to 5 | // revert to 'classic' fixed-space bitmap font. 6 | 7 | #ifndef _GFXFONT_H_ 8 | #define _GFXFONT_H_ 9 | 10 | typedef struct { // Data stored PER GLYPH 11 | uint16_t bitmapOffset; // Pointer into GFXfont->bitmap 12 | uint8_t width, height; // Bitmap dimensions in pixels 13 | uint8_t xAdvance; // Distance to advance cursor (x axis) 14 | int8_t xOffset, yOffset; // Dist from cursor pos to UL corner 15 | } GFXglyph; 16 | 17 | typedef struct { // Data stored for FONT AS A WHOLE: 18 | uint8_t *bitmap; // Glyph bitmaps, concatenated 19 | GFXglyph *glyph; // Glyph array 20 | uint8_t first, last; // ASCII extents 21 | uint8_t yAdvance; // Newline distance (y axis) 22 | } GFXfont; 23 | 24 | #endif // _GFXFONT_H_ 25 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 4516N41 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /libraries/SPFD5408 libraries/SPFD5408/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 JoaoLopesF 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DIY IC-Tester 2 | Arduino Mega 4000 & 7400 series IC tester with a 2,4" TFT Touch screen interface 3 | 4 | Based on Smart IC Tester by Baweja Akshay. 5 | 6 | His Git can be found here https://github.com/akshaybaweja/Smart-IC-Tester 7 | 8 | ------------------------------------------------------------------------------------------------ 9 | **Improvements and additional features** 10 | 11 | • No need to reboot the device after each test. 12 | 13 | • Interactive layout of ICs which lets the user check the functionality of ICs manually without additional circuitry. 14 | 15 | • Truthtable/Timing diagram generation, manually and automaticaly generated. Saves the truthtables as a CSV file. 16 | 17 | • Loop testing, the program keeps track of passed/failed tests and which pins are the most like to be the culprits. 18 | 19 | • Shortcut for Last test routine so the user can quickly set up a test for a sum of the same IC types. 20 | 21 | • Configuration where the user can tailor the behaviour of the program to suit their testing needs. 22 | 23 | • Added tests and pinouts for 20 & 24 Pin ICs. 24 | 25 | 26 | **Please read the IC Tester Manual.pdf for further information.** 27 | -------------------------------------------------------------------------------- /libraries/Adafruit libraries/Adafruit_TFTLCD/README.txt: -------------------------------------------------------------------------------- 1 | This is a library for the Adafruit 2.8" TFT display. 2 | This library works with the Adafruit 2.8" TFT Breakout w/SD card 3 | ----> http://www.adafruit.com/products/335 4 | as well as Adafruit TFT Touch Shield 5 | ----> http://www.adafruit.com/products/376 6 | 7 | Check out the links above for our tutorials and wiring diagrams. 8 | These displays use 8-bit parallel to communicate, 12 or 13 pins are required 9 | to interface (RST is optional). 10 | Adafruit invests time and resources providing this open source code, 11 | please support Adafruit and open-source hardware by purchasing 12 | products from Adafruit! 13 | 14 | Written by Limor Fried/Ladyada for Adafruit Industries. 15 | MIT license, all text above must be included in any redistribution 16 | 17 | To download. click the DOWNLOADS button in the top right corner, rename the uncompressed folder Adafruit_TFTLCD. Check that the Adafruit_TFTLCD folder contains Adafruit_TFTLCD.cpp and Adafruit_TFTLCD. 18 | 19 | Place the Adafruit_TFT library folder your /libraries/ folder. You may need to create the libraries subfolder if its your first library. Restart the IDE 20 | 21 | Also requires the Adafruit_GFX library for Arduino. https://github.com/adafruit/Adafruit-GFX-Library 22 | -------------------------------------------------------------------------------- /libraries/Adafruit libraries/TouchScreen/examples/touchscreendemo/touchscreendemo.pde: -------------------------------------------------------------------------------- 1 | // Touch screen library with X Y and Z (pressure) readings as well 2 | // as oversampling to avoid 'bouncing' 3 | // This demo code returns raw readings, public domain 4 | 5 | #include 6 | #include "TouchScreen.h" 7 | 8 | #define YP A2 // must be an analog pin, use "An" notation! 9 | #define XM A3 // must be an analog pin, use "An" notation! 10 | #define YM 8 // can be a digital pin 11 | #define XP 9 // can be a digital pin 12 | 13 | // For better pressure precision, we need to know the resistance 14 | // between X+ and X- Use any multimeter to read it 15 | // For the one we're using, its 300 ohms across the X plate 16 | TouchScreen ts = TouchScreen(XP, YP, XM, YM, 300); 17 | 18 | void setup(void) { 19 | Serial.begin(9600); 20 | } 21 | 22 | void loop(void) { 23 | // a point object holds x y and z coordinates 24 | TSPoint p = ts.getPoint(); 25 | 26 | // we have some minimum pressure we consider 'valid' 27 | // pressure of 0 means no pressing! 28 | if (p.z > ts.pressureThreshhold) { 29 | Serial.print("X = "); Serial.print(p.x); 30 | Serial.print("\tY = "); Serial.print(p.y); 31 | Serial.print("\tPressure = "); Serial.println(p.z); 32 | } 33 | 34 | delay(100); 35 | } 36 | -------------------------------------------------------------------------------- /libraries/SPFD5408 libraries/SPFD5408/adafruit_docs/README_ADAFRUIT_TFTLCD.txt: -------------------------------------------------------------------------------- 1 | This is a library for the Adafruit 2.8" TFT display. 2 | This library works with the Adafruit 2.8" TFT Breakout w/SD card 3 | ----> http://www.adafruit.com/products/335 4 | as well as Adafruit TFT Touch Shield 5 | ----> http://www.adafruit.com/products/376 6 | 7 | Check out the links above for our tutorials and wiring diagrams. 8 | These displays use 8-bit parallel to communicate, 12 or 13 pins are required 9 | to interface (RST is optional). 10 | Adafruit invests time and resources providing this open source code, 11 | please support Adafruit and open-source hardware by purchasing 12 | products from Adafruit! 13 | 14 | Written by Limor Fried/Ladyada for Adafruit Industries. 15 | MIT license, all text above must be included in any redistribution 16 | 17 | To download. click the DOWNLOADS button in the top right corner, rename the uncompressed folder Adafruit_TFTLCD. Check that the Adafruit_TFTLCD folder contains Adafruit_TFTLCD.cpp and Adafruit_TFTLCD. 18 | 19 | Place the Adafruit_TFT library folder your /libraries/ folder. You may need to create the libraries subfolder if its your first library. Restart the IDE 20 | 21 | Also requires the Adafruit_GFX library for Arduino. https://github.com/adafruit/Adafruit-GFX-Library 22 | -------------------------------------------------------------------------------- /libraries/Adafruit libraries/TouchScreen/examples/touchscreendemoshield/touchscreendemoshield.ino: -------------------------------------------------------------------------------- 1 | // Touch screen library with X Y and Z (pressure) readings as well 2 | // as oversampling to avoid 'bouncing' 3 | // This demo code returns raw readings, public domain 4 | 5 | #include 6 | #include "TouchScreen.h" 7 | 8 | // These are the pins for the shield! 9 | #define YP A1 // must be an analog pin, use "An" notation! 10 | #define XM A2 // must be an analog pin, use "An" notation! 11 | #define YM 7 // can be a digital pin 12 | #define XP 6 // can be a digital pin 13 | 14 | #define MINPRESSURE 10 15 | #define MAXPRESSURE 1000 16 | 17 | // For better pressure precision, we need to know the resistance 18 | // between X+ and X- Use any multimeter to read it 19 | // For the one we're using, its 300 ohms across the X plate 20 | TouchScreen ts = TouchScreen(XP, YP, XM, YM, 300); 21 | 22 | void setup(void) { 23 | Serial.begin(9600); 24 | } 25 | 26 | void loop(void) { 27 | // a point object holds x y and z coordinates 28 | TSPoint p = ts.getPoint(); 29 | 30 | // we have some minimum pressure we consider 'valid' 31 | // pressure of 0 means no pressing! 32 | if (p.z > MINPRESSURE && p.z < MAXPRESSURE) { 33 | Serial.print("X = "); Serial.print(p.x); 34 | Serial.print("\tY = "); Serial.print(p.y); 35 | Serial.print("\tPressure = "); Serial.println(p.z); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /libraries/SPFD5408 libraries/SPFD5408_TFT_Library/README.txt: -------------------------------------------------------------------------------- 1 | **Note:** 2 | * Modified to work with SPFD5408 - based on https://github.com/JoaoLopesF/SPFD5408 * 3 | 4 | This is a library for the Adafruit 2.8" TFT display. 5 | This library works with the Adafruit 2.8" TFT Breakout w/SD card 6 | ----> http://www.adafruit.com/products/335 7 | as well as Adafruit TFT Touch Shield 8 | ----> http://www.adafruit.com/products/376 9 | 10 | Check out the links above for our tutorials and wiring diagrams. 11 | These displays use 8-bit parallel to communicate, 12 or 13 pins are required 12 | to interface (RST is optional). 13 | Adafruit invests time and resources providing this open source code, 14 | please support Adafruit and open-source hardware by purchasing 15 | products from Adafruit! 16 | 17 | Written by Limor Fried/Ladyada for Adafruit Industries. 18 | MIT license, all text above must be included in any redistribution 19 | 20 | To download. click the DOWNLOADS button in the top right corner, rename the uncompressed folder Adafruit_TFTLCD. Check that the Adafruit_TFTLCD folder contains Adafruit_TFTLCD.cpp and Adafruit_TFTLCD. 21 | 22 | Place the Adafruit_TFT library folder your /libraries/ folder. You may need to create the libraries subfolder if its your first library. Restart the IDE 23 | 24 | Also requires the Adafruit_GFX library for Arduino. https://github.com/adafruit/Adafruit-GFX-Library 25 | -------------------------------------------------------------------------------- /libraries/SPFD5408 libraries/SPFD5408/fontconvert/makefonts.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Ugly little Bash script, generates a set of .h files for GFX using 4 | # GNU FreeFont sources. There are three fonts: 'Mono' (Courier-like), 5 | # 'Sans' (Helvetica-like) and 'Serif' (Times-like); four styles: regular, 6 | # bold, oblique or italic, and bold+oblique or bold+italic; and four 7 | # sizes: 9, 12, 18 and 24 point. No real error checking or anything, 8 | # this just powers through all the combinations, calling the fontconvert 9 | # utility and redirecting the output to a .h file for each combo. 10 | 11 | # Adafruit_GFX repository does not include the source outline fonts 12 | # (huge zipfile, different license) but they're easily acquired: 13 | # http://savannah.gnu.org/projects/freefont/ 14 | 15 | convert=./fontconvert 16 | inpath=~/Desktop/freefont/ 17 | outpath=../Fonts/ 18 | fonts=(FreeMono FreeSans FreeSerif) 19 | styles=("" Bold Italic BoldItalic Oblique BoldOblique) 20 | sizes=(9 12 18 24) 21 | 22 | for f in ${fonts[*]} 23 | do 24 | for index in ${!styles[*]} 25 | do 26 | st=${styles[$index]} 27 | for si in ${sizes[*]} 28 | do 29 | infile=$inpath$f$st".ttf" 30 | if [ -f $infile ] # Does source combination exist? 31 | then 32 | outfile=$outpath$f$st$si"pt7b.h" 33 | # printf "%s %s %s > %s\n" $convert $infile $si $outfile 34 | $convert $infile $si > $outfile 35 | fi 36 | done 37 | done 38 | done 39 | -------------------------------------------------------------------------------- /libraries/Adafruit libraries/Adafruit_GFX_Library/fontconvert/makefonts.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Ugly little Bash script, generates a set of .h files for GFX using 4 | # GNU FreeFont sources. There are three fonts: 'Mono' (Courier-like), 5 | # 'Sans' (Helvetica-like) and 'Serif' (Times-like); four styles: regular, 6 | # bold, oblique or italic, and bold+oblique or bold+italic; and four 7 | # sizes: 9, 12, 18 and 24 point. No real error checking or anything, 8 | # this just powers through all the combinations, calling the fontconvert 9 | # utility and redirecting the output to a .h file for each combo. 10 | 11 | # Adafruit_GFX repository does not include the source outline fonts 12 | # (huge zipfile, different license) but they're easily acquired: 13 | # http://savannah.gnu.org/projects/freefont/ 14 | 15 | convert=./fontconvert 16 | inpath=~/Desktop/freefont/ 17 | outpath=../Fonts/ 18 | fonts=(FreeMono FreeSans FreeSerif) 19 | styles=("" Bold Italic BoldItalic Oblique BoldOblique) 20 | sizes=(9 12 18 24) 21 | 22 | for f in ${fonts[*]} 23 | do 24 | for index in ${!styles[*]} 25 | do 26 | st=${styles[$index]} 27 | for si in ${sizes[*]} 28 | do 29 | infile=$inpath$f$st".ttf" 30 | if [ -f $infile ] # Does source combination exist? 31 | then 32 | outfile=$outpath$f$st$si"pt7b.h" 33 | # printf "%s %s %s > %s\n" $convert $infile $si $outfile 34 | $convert $infile $si > $outfile 35 | fi 36 | done 37 | done 38 | done 39 | -------------------------------------------------------------------------------- /libraries/SPFD5408 libraries/SPFD5408/license.txt: -------------------------------------------------------------------------------- 1 | Software License Agreement (BSD License) 2 | 3 | Copyright (c) Joao Lopes. All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | - Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | - Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | POSSIBILITY OF SUCH DAMAGE. 25 | -------------------------------------------------------------------------------- /libraries/Adafruit libraries/Adafruit_GFX_Library/license.txt: -------------------------------------------------------------------------------- 1 | Software License Agreement (BSD License) 2 | 3 | Copyright (c) 2012 Adafruit Industries. All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | - Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | - Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | POSSIBILITY OF SUCH DAMAGE. 25 | -------------------------------------------------------------------------------- /libraries/SPFD5408 libraries/SPFD5408/adafruit_docs/license.txt: -------------------------------------------------------------------------------- 1 | Software License Agreement (BSD License) 2 | 3 | Copyright (c) 2012 Adafruit Industries. All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | - Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | - Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | POSSIBILITY OF SUCH DAMAGE. 25 | -------------------------------------------------------------------------------- /libraries/SD library/SD/.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | Thank you for creating a pull request to contribute to Adafruit's GitHub code! 2 | Before you open the request please review the following guidelines and tips to 3 | help it be more easily integrated: 4 | 5 | - **Describe the scope of your change--i.e. what the change does and what parts 6 | of the code were modified.** This will help us understand any risks of integrating 7 | the code. 8 | 9 | - **Describe any known limitations with your change.** For example if the change 10 | doesn't apply to a supported platform of the library please mention it. 11 | 12 | - **Please run any tests or examples that can exercise your modified code.** We 13 | strive to not break users of the code and running tests/examples helps with this 14 | process. 15 | 16 | Thank you again for contributing! We will try to test and integrate the change 17 | as soon as we can, but be aware we have many GitHub repositories to manage and 18 | can't immediately respond to every request. There is no need to bump or check in 19 | on a pull request (it will clutter the discussion of the request). 20 | 21 | Also don't be worried if the request is closed or not integrated--sometimes the 22 | priorities of Adafruit's GitHub code (education, ease of use) might not match the 23 | priorities of the pull request. Don't fret, the open source community thrives on 24 | forks and GitHub makes it easy to keep your changes in a forked repo. 25 | 26 | After reviewing the guidelines above you can delete this text from the pull request. 27 | -------------------------------------------------------------------------------- /libraries/README.md: -------------------------------------------------------------------------------- 1 | # Libraries 2 | 3 | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 4 | **SD library** 5 | 6 | This library needs to be referenced to directly or you need to override the one that comes with the arduino IDE. Placing it into you library folder in documents isn't enough!!! 7 | 8 | for Arduino IDE 2 on Windows 10 it can be found here. **Users\UserName\AppData\Local\Arduino15\libraries** 9 | 10 | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 11 | **TFT Libraries** 12 | 13 | Sadly there are plenty of different screens and controllers being sold as the same thing. 14 | 15 | I have only acquired and tested the SPFD5408 variants and even they don't work exactly the same... :[ 16 | 17 | If your screen only shows white after you have uploaded the sketch you probably need the other one. as in the adafruit type instead of the SPFD one or vice versa 18 | 19 | If you have graphics on your screen after uploading but touch doesn't work and/or is inverted then you need to read the manual which goes into more depth on the subject. 20 | 21 | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 22 | **Kicksort library** 23 | 24 | The alphabetical sorting library used with the IC tester. Put it in your libraries folder **Documents/Arduino/libraries** 25 | 26 | -------------------------------------------------------------------------------- /libraries/SPFD5408 libraries/SPFD5408/adafruit_docs/README_ADAFRUIT_GFX.txt: -------------------------------------------------------------------------------- 1 | This is the core graphics library for all our displays, providing a common set of graphics primitives (points, lines, circles, etc.). It needs to be paired with a hardware-specific library for each display device we carry (to handle the lower-level functions). 2 | 3 | Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit! 4 | 5 | Written by Limor Fried/Ladyada for Adafruit Industries. 6 | BSD license, check license.txt for more information. 7 | All text above must be included in any redistribution. 8 | 9 | To download, click the DOWNLOAD ZIP button, uncompress and rename the uncompressed folder Adafruit_GFX. Confirm that the Adafruit_GFX folder contains Adafruit_GFX.cpp and Adafruit_GFX.h 10 | 11 | Place the Adafruit_GFX library folder your /Libraries/ folder. You may need to create the Libraries subfolder if its your first library. Restart the IDE. 12 | 13 | Useful Resources 14 | ================ 15 | 16 | - Image2Code 17 | This is a handy Java GUI utility to convert a BMP file into the array code necessary to display the image with the drawBitmap function. Check out the code at ehubin's GitHub repository: 18 | https://github.com/ehubin/Adafruit-GFX-Library/tree/master/Img2Code 19 | 20 | - drawXBitmap function 21 | You can use the GIMP photo editor to save a .xbm file and use the array saved in the file to draw a bitmap with the drawXBitmap function. See the pull request here for more details: 22 | https://github.com/adafruit/Adafruit-GFX-Library/pull/31 23 | -------------------------------------------------------------------------------- /libraries/Adafruit libraries/Adafruit_GFX_Library/README.md: -------------------------------------------------------------------------------- 1 | # Adafruit GFX Library 2 | 3 | This is the core graphics library for all our displays, providing a common set of graphics primitives (points, lines, circles, etc.). It needs to be paired with a hardware-specific library for each display device we carry (to handle the lower-level functions). 4 | 5 | Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit! 6 | 7 | Written by Limor Fried/Ladyada for Adafruit Industries. 8 | BSD license, check license.txt for more information. 9 | All text above must be included in any redistribution. 10 | 11 | Recent Arduino IDE releases include the Library Manager for easy installation. Otherwise, to download, click the DOWNLOAD ZIP button, uncompress and rename the uncompressed folder Adafruit_GFX. Confirm that the Adafruit_GFX folder contains Adafruit_GFX.cpp and Adafruit_GFX.h. Place the Adafruit_GFX library folder your /Libraries/ folder. You may need to create the Libraries subfolder if its your first library. Restart the IDE. 12 | 13 | # Useful Resources 14 | 15 | - Image2Code: This is a handy Java GUI utility to convert a BMP file into the array code necessary to display the image with the drawBitmap function. Check out the code at ehubin's GitHub repository: https://github.com/ehubin/Adafruit-GFX-Library/tree/master/Img2Code 16 | 17 | - drawXBitmap function: You can use the GIMP photo editor to save a .xbm file and use the array saved in the file to draw a bitmap with the drawXBitmap function. See the pull request here for more details: https://github.com/adafruit/Adafruit-GFX-Library/pull/31 18 | 19 | - 'Fonts' folder contains bitmap fonts for use with recent (1.1 and later) Adafruit_GFX. To use a font in your Arduino sketch, #include the corresponding .h file and pass address of GFXfont struct to setFont(). Pass NULL to revert to 'classic' fixed-space bitmap font. 20 | 21 | - 'fontconvert' folder contains a command-line tool for converting TTF fonts to Adafruit_GFX .h format. 22 | -------------------------------------------------------------------------------- /libraries/SPFD5408 libraries/SPFD5408/examples/spfd5408_tftgrid/spfd5408_tftgrid.ino: -------------------------------------------------------------------------------- 1 | /////////////// 2 | // Sketch: Grid TFT 3 | // Author: Joao Lopes F. - joaolopesf@gmail.com 4 | // library SPFD5408 5 | 6 | /// Grid for help in design of screens 7 | 8 | #include // Core graphics library 9 | #include // Hardware-specific library 10 | 11 | // LCD Pin 12 | 13 | #define LCD_CS A3 // CS 14 | #define LCD_CD A2 // RS 15 | #define LCD_WR A1 // WR 16 | #define LCD_RD A0 // RD 17 | #define LCD_RESET A4 // Optional : otherwise connect to Arduino's reset pin 18 | 19 | // Assign human-readable names to some common 16-bit color values: 20 | #define BLACK 0x0000 21 | #define BLUE 0x001F 22 | #define RED 0xF800 23 | #define GREEN 0x07E0 24 | #define CYAN 0x07FF 25 | #define MAGENTA 0xF81F 26 | #define YELLOW 0xFFE0 27 | #define WHITE 0xFFFF 28 | 29 | // Init LCD 30 | 31 | Adafruit_TFTLCD tft(LCD_CS, LCD_CD, LCD_WR, LCD_RD, LCD_RESET); 32 | 33 | //-- Setup 34 | 35 | void setup(void) { 36 | 37 | // Inicialize the controller 38 | 39 | tft.reset(); 40 | 41 | tft.begin(0x9341); 42 | 43 | tft.setRotation(0); // Need for the Mega, please changed for your choice or rotation initial 44 | 45 | // Screen white 46 | 47 | tft.fillScreen(WHITE); 48 | 49 | // Grid 50 | 51 | drawGrid(); 52 | 53 | // Texts 54 | 55 | tft.setCursor (0, 20); 56 | 57 | tft.setTextColor(RED); 58 | for (uint8_t size = 1; size <= 5; size++) { 59 | tft.setTextSize (size); 60 | tft.setCursor (0, 20 * size * 2); 61 | tft.print(size); 62 | tft.print("-"); 63 | tft.println("ABC123"); 64 | } 65 | 66 | } 67 | 68 | // -- Loop 69 | 70 | void loop() 71 | { 72 | } 73 | 74 | // Draw a grid 75 | 76 | void drawGrid () { 77 | 78 | for(uint16_t y = 0; y <= 340; y+=5) 79 | tft.drawFastHLine(0, y, 240, BLACK); 80 | for(uint16_t x = 0; x <= 240; x+=5) 81 | tft.drawFastVLine(x, 0, 340, BLACK); 82 | 83 | tft.setTextColor(BLACK); 84 | tft.setTextSize (1); 85 | 86 | for(uint16_t y = 0; y <= 340; y+=25) { 87 | tft.setCursor (200, y); 88 | tft.print(y); 89 | } 90 | } 91 | 92 | -------------------------------------------------------------------------------- /libraries/SD library/SD/examples/DumpFile/DumpFile.ino: -------------------------------------------------------------------------------- 1 | /* 2 | SD card file dump 3 | 4 | This example shows how to read a file from the SD card using the 5 | SD library and send it over the serial port. 6 | 7 | The circuit: 8 | * SD card attached to SPI bus as follows: 9 | ** UNO: MOSI - pin 11, MISO - pin 12, CLK - pin 13, CS - pin 4 (CS pin can be changed) 10 | and pin #10 (SS) must be an output 11 | ** Mega: MOSI - pin 51, MISO - pin 50, CLK - pin 52, CS - pin 4 (CS pin can be changed) 12 | and pin #52 (SS) must be an output 13 | ** Leonardo: Connect to hardware SPI via the ICSP header 14 | 15 | created 22 December 2010 by Limor Fried 16 | modified 9 Apr 2012 by Tom Igoe 17 | 18 | This example code is in the public domain. 19 | 20 | */ 21 | 22 | #include 23 | #include 24 | 25 | // change this to match your SD shield or module; 26 | // Arduino Ethernet shield: pin 4 27 | // Adafruit SD shields and modules: pin 10 28 | // Sparkfun SD shield: pin 8 29 | const int chipSelect = 4; 30 | 31 | void setup() 32 | { 33 | // Open serial communications and wait for port to open: 34 | Serial.begin(9600); 35 | while (!Serial) { 36 | ; // wait for serial port to connect. Needed for Leonardo only 37 | } 38 | 39 | 40 | Serial.print("Initializing SD card..."); 41 | // make sure that the default chip select pin is set to 42 | // output, even if you don't use it: 43 | pinMode(SS, OUTPUT); 44 | 45 | // see if the card is present and can be initialized: 46 | if (!SD.begin(chipSelect)) { 47 | Serial.println("Card failed, or not present"); 48 | // don't do anything more: 49 | return; 50 | } 51 | Serial.println("card initialized."); 52 | 53 | // open the file. note that only one file can be open at a time, 54 | // so you have to close this one before opening another. 55 | File dataFile = SD.open("datalog.txt"); 56 | 57 | // if the file is available, write to it: 58 | if (dataFile) { 59 | while (dataFile.available()) { 60 | Serial.write(dataFile.read()); 61 | } 62 | dataFile.close(); 63 | } 64 | // if the file isn't open, pop up an error: 65 | else { 66 | Serial.println("error opening datalog.txt"); 67 | } 68 | } 69 | 70 | void loop() 71 | { 72 | } 73 | 74 | -------------------------------------------------------------------------------- /libraries/SD library/SD/examples/Files/Files.ino: -------------------------------------------------------------------------------- 1 | /* 2 | SD card basic file example 3 | 4 | This example shows how to create and destroy an SD card file 5 | The circuit: 6 | * SD card attached to SPI bus as follows: 7 | ** UNO: MOSI - pin 11, MISO - pin 12, CLK - pin 13, CS - pin 4 (CS pin can be changed) 8 | and pin #10 (SS) must be an output 9 | ** Mega: MOSI - pin 51, MISO - pin 50, CLK - pin 52, CS - pin 4 (CS pin can be changed) 10 | and pin #52 (SS) must be an output 11 | ** Leonardo: Connect to hardware SPI via the ICSP header 12 | 13 | created Nov 2010 14 | by David A. Mellis 15 | modified 9 Apr 2012 16 | by Tom Igoe 17 | 18 | This example code is in the public domain. 19 | 20 | */ 21 | #include 22 | #include 23 | 24 | File myFile; 25 | 26 | // change this to match your SD shield or module; 27 | // Arduino Ethernet shield: pin 4 28 | // Adafruit SD shields and modules: pin 10 29 | // Sparkfun SD shield: pin 8 30 | const int chipSelect = 4; 31 | 32 | void setup() 33 | { 34 | // Open serial communications and wait for port to open: 35 | Serial.begin(9600); 36 | while (!Serial) { 37 | ; // wait for serial port to connect. Needed for Leonardo only 38 | } 39 | 40 | 41 | Serial.print("Initializing SD card..."); 42 | // On the Ethernet Shield, CS is pin 4. It's set as an output by default. 43 | // Note that even if it's not used as the CS pin, the hardware SS pin 44 | // (10 on most Arduino boards, 53 on the Mega) must be left as an output 45 | // or the SD library functions will not work. 46 | pinMode(SS, OUTPUT); 47 | 48 | if (!SD.begin(chipSelect)) { 49 | Serial.println("initialization failed!"); 50 | return; 51 | } 52 | Serial.println("initialization done."); 53 | 54 | if (SD.exists("example.txt")) { 55 | Serial.println("example.txt exists."); 56 | } 57 | else { 58 | Serial.println("example.txt doesn't exist."); 59 | } 60 | 61 | // open a new file and immediately close it: 62 | Serial.println("Creating example.txt..."); 63 | myFile = SD.open("example.txt", FILE_WRITE); 64 | myFile.close(); 65 | 66 | // Check to see if the file exists: 67 | if (SD.exists("example.txt")) { 68 | Serial.println("example.txt exists."); 69 | } 70 | else { 71 | Serial.println("example.txt doesn't exist."); 72 | } 73 | 74 | // delete the file: 75 | Serial.println("Removing example.txt..."); 76 | SD.remove("example.txt"); 77 | 78 | if (SD.exists("example.txt")){ 79 | Serial.println("example.txt exists."); 80 | } 81 | else { 82 | Serial.println("example.txt doesn't exist."); 83 | } 84 | } 85 | 86 | void loop() 87 | { 88 | // nothing happens after setup finishes. 89 | } 90 | 91 | 92 | 93 | -------------------------------------------------------------------------------- /libraries/SD library/SD/.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | Thank you for opening an issue on an Adafruit Arduino library repository. To 2 | improve the speed of resolution please review the following guidelines and 3 | common troubleshooting steps below before creating the issue: 4 | 5 | - **Do not use GitHub issues for troubleshooting projects and issues.** Instead use 6 | the forums at http://forums.adafruit.com to ask questions and troubleshoot why 7 | something isn't working as expected. In many cases the problem is a common issue 8 | that you will more quickly receive help from the forum community. GitHub issues 9 | are meant for known defects in the code. If you don't know if there is a defect 10 | in the code then start with troubleshooting on the forum first. 11 | 12 | - **If following a tutorial or guide be sure you didn't miss a step.** Carefully 13 | check all of the steps and commands to run have been followed. Consult the 14 | forum if you're unsure or have questions about steps in a guide/tutorial. 15 | 16 | - **For Arduino projects check these very common issues to ensure they don't apply**: 17 | 18 | - For uploading sketches or communicating with the board make sure you're using 19 | a **USB data cable** and **not** a **USB charge-only cable**. It is sometimes 20 | very hard to tell the difference between a data and charge cable! Try using the 21 | cable with other devices or swapping to another cable to confirm it is not 22 | the problem. 23 | 24 | - **Be sure you are supplying adequate power to the board.** Check the specs of 25 | your board and plug in an external power supply. In many cases just 26 | plugging a board into your computer is not enough to power it and other 27 | peripherals. 28 | 29 | - **Double check all soldering joints and connections.** Flakey connections 30 | cause many mysterious problems. See the [guide to excellent soldering](https://learn.adafruit.com/adafruit-guide-excellent-soldering/tools) for examples of good solder joints. 31 | 32 | - **Ensure you are using an official Arduino or Adafruit board.** We can't 33 | guarantee a clone board will have the same functionality and work as expected 34 | with this code and don't support them. 35 | 36 | If you're sure this issue is a defect in the code and checked the steps above 37 | please fill in the following fields to provide enough troubleshooting information. 38 | You may delete the guideline and text above to just leave the following details: 39 | 40 | - Arduino board: **INSERT ARDUINO BOARD NAME/TYPE HERE** 41 | 42 | - Arduino IDE version (found in Arduino -> About Arduino menu): **INSERT ARDUINO 43 | VERSION HERE** 44 | 45 | - List the steps to reproduce the problem below (if possible attach a sketch or 46 | copy the sketch code in too): **LIST REPRO STEPS BELOW** 47 | -------------------------------------------------------------------------------- /libraries/SD library/SD/examples/ReadWrite/ReadWrite.ino: -------------------------------------------------------------------------------- 1 | /* 2 | SD card read/write 3 | 4 | This example shows how to read and write data to and from an SD card file 5 | The circuit: 6 | * SD card attached to SPI bus as follows: 7 | ** UNO: MOSI - pin 11, MISO - pin 12, CLK - pin 13, CS - pin 4 (CS pin can be changed) 8 | and pin #10 (SS) must be an output 9 | ** Mega: MOSI - pin 51, MISO - pin 50, CLK - pin 52, CS - pin 4 (CS pin can be changed) 10 | and pin #52 (SS) must be an output 11 | ** Leonardo: Connect to hardware SPI via the ICSP header 12 | 13 | 14 | created Nov 2010 by David A. Mellis 15 | modified 9 Apr 2012 by Tom Igoe 16 | 17 | This example code is in the public domain. 18 | 19 | */ 20 | 21 | #include 22 | #include 23 | 24 | File myFile; 25 | 26 | // change this to match your SD shield or module; 27 | // Arduino Ethernet shield: pin 4 28 | // Adafruit SD shields and modules: pin 10 29 | // Sparkfun SD shield: pin 8 30 | const int chipSelect = 4; 31 | 32 | void setup() 33 | { 34 | // Open serial communications and wait for port to open: 35 | Serial.begin(9600); 36 | while (!Serial) { 37 | ; // wait for serial port to connect. Needed for Leonardo only 38 | } 39 | 40 | 41 | Serial.print("Initializing SD card..."); 42 | // On the Ethernet Shield, CS is pin 4. It's set as an output by default. 43 | // Note that even if it's not used as the CS pin, the hardware SS pin 44 | // (10 on most Arduino boards, 53 on the Mega) must be left as an output 45 | // or the SD library functions will not work. 46 | pinMode(SS, OUTPUT); 47 | 48 | if (!SD.begin(chipSelect)) { 49 | Serial.println("initialization failed!"); 50 | return; 51 | } 52 | Serial.println("initialization done."); 53 | 54 | // open the file. note that only one file can be open at a time, 55 | // so you have to close this one before opening another. 56 | myFile = SD.open("test.txt", FILE_WRITE); 57 | 58 | // if the file opened okay, write to it: 59 | if (myFile) { 60 | Serial.print("Writing to test.txt..."); 61 | myFile.println("testing 1, 2, 3."); 62 | // close the file: 63 | myFile.close(); 64 | Serial.println("done."); 65 | } else { 66 | // if the file didn't open, print an error: 67 | Serial.println("error opening test.txt"); 68 | } 69 | 70 | // re-open the file for reading: 71 | myFile = SD.open("test.txt"); 72 | if (myFile) { 73 | Serial.println("test.txt:"); 74 | 75 | // read from the file until there's nothing else in it: 76 | while (myFile.available()) { 77 | Serial.write(myFile.read()); 78 | } 79 | // close the file: 80 | myFile.close(); 81 | } else { 82 | // if the file didn't open, print an error: 83 | Serial.println("error opening test.txt"); 84 | } 85 | } 86 | 87 | void loop() 88 | { 89 | // nothing happens after setup 90 | } 91 | 92 | 93 | -------------------------------------------------------------------------------- /libraries/SD library/SD/examples/listfiles/listfiles.ino: -------------------------------------------------------------------------------- 1 | /* 2 | SD card basic file example 3 | 4 | This example shows how to create and destroy an SD card file 5 | The circuit: 6 | * SD card attached to SPI bus as follows: 7 | ** UNO: MOSI - pin 11, MISO - pin 12, CLK - pin 13, CS - pin 4 (CS pin can be changed) 8 | and pin #10 (SS) must be an output 9 | ** Mega: MOSI - pin 51, MISO - pin 50, CLK - pin 52, CS - pin 4 (CS pin can be changed) 10 | and pin #52 (SS) must be an output 11 | ** Leonardo: Connect to hardware SPI via the ICSP header 12 | 13 | created Nov 2010 by David A. Mellis 14 | modified 9 Apr 2012 by Tom Igoe 15 | modified 13 June 2012 by Limor Fried 16 | 17 | This example code is in the public domain. 18 | 19 | */ 20 | #include 21 | #include 22 | 23 | File root; 24 | 25 | // change this to match your SD shield or module; 26 | // Arduino Ethernet shield: pin 4 27 | // Adafruit SD shields and modules: pin 10 28 | // Sparkfun SD shield: pin 8 29 | const int chipSelect = 4; 30 | 31 | void setup() 32 | { 33 | // Open serial communications and wait for port to open: 34 | Serial.begin(9600); 35 | while (!Serial) { 36 | ; // wait for serial port to connect. Needed for Leonardo only 37 | } 38 | 39 | 40 | Serial.print("Initializing SD card..."); 41 | // On the Ethernet Shield, CS is pin 4. It's set as an output by default. 42 | // Note that even if it's not used as the CS pin, the hardware SS pin 43 | // (10 on Arduino Uno boards, 53 on the Mega) must be left as an output 44 | // or the SD library functions will not work. 45 | pinMode(SS, OUTPUT); 46 | 47 | if (!SD.begin(chipSelect)) { 48 | Serial.println("initialization failed!"); 49 | return; 50 | } 51 | Serial.println("initialization done."); 52 | 53 | root = SD.open("/"); 54 | 55 | printDirectory(root, 0); 56 | 57 | Serial.println("done!"); 58 | } 59 | 60 | void loop() 61 | { 62 | // nothing happens after setup finishes. 63 | } 64 | 65 | void printDirectory(File dir, int numTabs) { 66 | // Begin at the start of the directory 67 | dir.rewindDirectory(); 68 | 69 | while(true) { 70 | File entry = dir.openNextFile(); 71 | if (! entry) { 72 | // no more files 73 | //Serial.println("**nomorefiles**"); 74 | break; 75 | } 76 | for (uint8_t i=0; i. 19 | */ 20 | #ifndef SdFatUtil_h 21 | #define SdFatUtil_h 22 | /** 23 | * \file 24 | * Useful utility functions. 25 | */ 26 | #include 27 | #ifdef __AVR__ 28 | #include 29 | /** Store and print a string in flash memory.*/ 30 | #define PgmPrint(x) SerialPrint_P(PSTR(x)) 31 | /** Store and print a string in flash memory followed by a CR/LF.*/ 32 | #define PgmPrintln(x) SerialPrintln_P(PSTR(x)) 33 | /** Defined so doxygen works for function definitions. */ 34 | #endif 35 | #define NOINLINE __attribute__((noinline,unused)) 36 | #define UNUSEDOK __attribute__((unused)) 37 | //------------------------------------------------------------------------------ 38 | /** Return the number of bytes currently free in RAM. */ 39 | static UNUSEDOK int FreeRam(void) { 40 | extern int __bss_end; 41 | extern int* __brkval; 42 | int free_memory; 43 | if (reinterpret_cast(__brkval) == 0) { 44 | // if no heap use from end of bss section 45 | free_memory = reinterpret_cast(&free_memory) 46 | - reinterpret_cast(&__bss_end); 47 | } else { 48 | // use from top of stack to heap 49 | free_memory = reinterpret_cast(&free_memory) 50 | - reinterpret_cast(__brkval); 51 | } 52 | return free_memory; 53 | } 54 | #ifdef __AVR__ 55 | //------------------------------------------------------------------------------ 56 | /** 57 | * %Print a string in flash memory to the serial port. 58 | * 59 | * \param[in] str Pointer to string stored in flash memory. 60 | */ 61 | static NOINLINE void SerialPrint_P(PGM_P str) { 62 | for (uint8_t c; (c = pgm_read_byte(str)); str++) Serial.write(c); 63 | } 64 | //------------------------------------------------------------------------------ 65 | /** 66 | * %Print a string in flash memory followed by a CR/LF. 67 | * 68 | * \param[in] str Pointer to string stored in flash memory. 69 | */ 70 | static NOINLINE void SerialPrintln_P(PGM_P str) { 71 | SerialPrint_P(str); 72 | Serial.println(); 73 | } 74 | #endif // __AVR__ 75 | #endif // #define SdFatUtil_h 76 | -------------------------------------------------------------------------------- /libraries/Adafruit libraries/Adafruit_GFX_Library/Adafruit_SPITFT.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _ADAFRUIT_SPITFT_ 3 | #define _ADAFRUIT_SPITFT_ 4 | 5 | 6 | #if ARDUINO >= 100 7 | #include "Arduino.h" 8 | #include "Print.h" 9 | #else 10 | #include "WProgram.h" 11 | #endif 12 | #include 13 | #include "Adafruit_GFX.h" 14 | 15 | 16 | #if defined(ARDUINO_STM32_FEATHER) 17 | typedef volatile uint32 RwReg; 18 | #endif 19 | #if defined(ARDUINO_FEATHER52) 20 | typedef volatile uint32_t RwReg; 21 | #endif 22 | 23 | class Adafruit_SPITFT : public Adafruit_GFX { 24 | protected: 25 | 26 | public: 27 | Adafruit_SPITFT(uint16_t w, uint16_t h, int8_t _CS, int8_t _DC, int8_t _MOSI, int8_t _SCLK, int8_t _RST = -1, int8_t _MISO = -1); 28 | Adafruit_SPITFT(uint16_t w, uint16_t h, int8_t _CS, int8_t _DC, int8_t _RST = -1); 29 | 30 | virtual void begin(uint32_t freq) = 0; 31 | void initSPI(uint32_t freq); 32 | 33 | // Required Non-Transaction 34 | void drawPixel(int16_t x, int16_t y, uint16_t color); 35 | 36 | // Transaction API 37 | void startWrite(void); 38 | void endWrite(void); 39 | void writePixel(int16_t x, int16_t y, uint16_t color); 40 | void writeFillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color); 41 | void writeFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color); 42 | void writeFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color); 43 | 44 | // Transaction API not used by GFX 45 | virtual void setAddrWindow(uint16_t x, uint16_t y, uint16_t w, uint16_t h) = 0; 46 | void writePixel(uint16_t color); 47 | void writePixels(uint16_t * colors, uint32_t len); 48 | void writeColor(uint16_t color, uint32_t len); 49 | void pushColor(uint16_t color); 50 | 51 | // Recommended Non-Transaction 52 | void drawFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color); 53 | void drawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color); 54 | void fillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color); 55 | 56 | using Adafruit_GFX::drawRGBBitmap; // Check base class first 57 | void drawRGBBitmap(int16_t x, int16_t y, 58 | uint16_t *pcolors, int16_t w, int16_t h); 59 | 60 | uint16_t color565(uint8_t r, uint8_t g, uint8_t b); 61 | 62 | protected: 63 | uint32_t _freq; 64 | #if defined (__AVR__) || defined(TEENSYDUINO) || defined (ESP8266) || defined (ESP32) 65 | int8_t _cs, _dc, _rst, _sclk, _mosi, _miso; 66 | #else 67 | int32_t _cs, _dc, _rst, _sclk, _mosi, _miso; 68 | #endif 69 | 70 | #ifdef USE_FAST_PINIO 71 | volatile RwReg *mosiport, *misoport, *clkport, *dcport, *csport; 72 | RwReg mosipinmask, misopinmask, clkpinmask, cspinmask, dcpinmask; 73 | #endif 74 | 75 | void writeCommand(uint8_t cmd); 76 | void spiWrite(uint8_t v); 77 | uint8_t spiRead(void); 78 | }; 79 | 80 | #endif 81 | -------------------------------------------------------------------------------- /libraries/SD library/SD/examples/Datalogger/Datalogger.ino: -------------------------------------------------------------------------------- 1 | /* 2 | SD card datalogger 3 | 4 | This example shows how to log data from three analog sensors 5 | to an SD card using the SD library. 6 | 7 | The circuit: 8 | * SD card attached to SPI bus as follows: 9 | ** UNO: MOSI - pin 11, MISO - pin 12, CLK - pin 13, CS - pin 4 (CS pin can be changed) 10 | and pin #10 (SS) must be an output 11 | ** Mega: MOSI - pin 51, MISO - pin 50, CLK - pin 52, CS - pin 4 (CS pin can be changed) 12 | and pin #52 (SS) must be an output 13 | ** Leonardo: Connect to hardware SPI via the ICSP header 14 | Pin 4 used here for consistency with other Arduino examples 15 | 16 | created 24 Nov 2010 17 | modified 9 Apr 2012 by Tom Igoe 18 | 19 | This example code is in the public domain. 20 | 21 | */ 22 | 23 | #include 24 | #include 25 | 26 | // On the Ethernet Shield, CS is pin 4. Note that even if it's not 27 | // used as the CS pin, the hardware CS pin (10 on most Arduino boards, 28 | // 53 on the Mega) must be left as an output or the SD library 29 | // functions will not work. 30 | const int chipSelect = 4; 31 | 32 | File dataFile; 33 | 34 | void setup() 35 | { 36 | // Open serial communications and wait for port to open: 37 | Serial.begin(9600); 38 | while (!Serial) { 39 | ; // wait for serial port to connect. Needed for Leonardo only 40 | } 41 | 42 | 43 | Serial.print("Initializing SD card..."); 44 | // make sure that the default chip select pin is set to 45 | // output, even if you don't use it: 46 | pinMode(SS, OUTPUT); 47 | 48 | // see if the card is present and can be initialized: 49 | if (!SD.begin(chipSelect)) { 50 | Serial.println("Card failed, or not present"); 51 | // don't do anything more: 52 | while (1) ; 53 | } 54 | Serial.println("card initialized."); 55 | 56 | // Open up the file we're going to log to! 57 | dataFile = SD.open("datalog.txt", FILE_WRITE); 58 | if (! dataFile) { 59 | Serial.println("error opening datalog.txt"); 60 | // Wait forever since we cant write data 61 | while (1) ; 62 | } 63 | } 64 | 65 | void loop() 66 | { 67 | // make a string for assembling the data to log: 68 | String dataString = ""; 69 | 70 | // read three sensors and append to the string: 71 | for (int analogPin = 0; analogPin < 3; analogPin++) { 72 | int sensor = analogRead(analogPin); 73 | dataString += String(sensor); 74 | if (analogPin < 2) { 75 | dataString += ","; 76 | } 77 | } 78 | 79 | dataFile.println(dataString); 80 | 81 | // print to the serial port too: 82 | Serial.println(dataString); 83 | 84 | // The following line will 'save' the file to the SD card after every 85 | // line of data - this will use more power and slow down how much data 86 | // you can read but it's safer! 87 | // If you want to speed up the system, remove the call to flush() and it 88 | // will save the file only every 512 bytes - every time a sector on the 89 | // SD card is filled with data. 90 | dataFile.flush(); 91 | 92 | // Take 1 measurement every 500 milliseconds 93 | delay(500); 94 | } 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | -------------------------------------------------------------------------------- /libraries/SD library/SD/File.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | SD - a slightly more friendly wrapper for sdfatlib 4 | 5 | This library aims to expose a subset of SD card functionality 6 | in the form of a higher level "wrapper" object. 7 | 8 | License: GNU General Public License V3 9 | (Because sdfatlib is licensed with this.) 10 | 11 | (C) Copyright 2010 SparkFun Electronics 12 | 13 | */ 14 | 15 | #include 16 | 17 | /* for debugging file open/close leaks 18 | uint8_t nfilecount=0; 19 | */ 20 | 21 | File::File(SdFile f, const char *n) { 22 | // oh man you are kidding me, new() doesnt exist? Ok we do it by hand! 23 | _file = (SdFile *)malloc(sizeof(SdFile)); 24 | if (_file) { 25 | memcpy(_file, &f, sizeof(SdFile)); 26 | 27 | strncpy(_name, n, 12); 28 | _name[12] = 0; 29 | 30 | /* for debugging file open/close leaks 31 | nfilecount++; 32 | Serial.print("Created \""); 33 | Serial.print(n); 34 | Serial.print("\": "); 35 | Serial.println(nfilecount, DEC); 36 | */ 37 | } 38 | } 39 | 40 | File::File(void) { 41 | _file = 0; 42 | _name[0] = 0; 43 | //Serial.print("Created empty file object"); 44 | } 45 | 46 | File::~File(void) { 47 | // Serial.print("Deleted file object"); 48 | } 49 | 50 | // returns a pointer to the file name 51 | char *File::name(void) { 52 | return _name; 53 | } 54 | 55 | // a directory is a special type of file 56 | boolean File::isDirectory(void) { 57 | return (_file && _file->isDir()); 58 | } 59 | 60 | 61 | size_t File::write(uint8_t val) { 62 | return write(&val, 1); 63 | } 64 | 65 | size_t File::write(const uint8_t *buf, size_t size) { 66 | size_t t; 67 | if (!_file) { 68 | setWriteError(); 69 | return 0; 70 | } 71 | _file->clearWriteError(); 72 | t = _file->write(buf, size); 73 | if (_file->getWriteError()) { 74 | setWriteError(); 75 | return 0; 76 | } 77 | return t; 78 | } 79 | 80 | int File::peek() { 81 | if (! _file) 82 | return 0; 83 | 84 | int c = _file->read(); 85 | if (c != -1) _file->seekCur(-1); 86 | return c; 87 | } 88 | 89 | int File::read() { 90 | if (_file) 91 | return _file->read(); 92 | return -1; 93 | } 94 | 95 | // buffered read for more efficient, high speed reading 96 | int File::read(void *buf, uint16_t nbyte) { 97 | if (_file) 98 | return _file->read(buf, nbyte); 99 | return 0; 100 | } 101 | 102 | int File::available() { 103 | if (! _file) return 0; 104 | 105 | uint32_t n = size() - position(); 106 | 107 | return n > 0X7FFF ? 0X7FFF : n; 108 | } 109 | 110 | void File::flush() { 111 | if (_file) 112 | _file->sync(); 113 | } 114 | 115 | boolean File::seek(uint32_t pos) { 116 | if (! _file) return false; 117 | 118 | return _file->seekSet(pos); 119 | } 120 | 121 | uint32_t File::position() { 122 | if (! _file) return -1; 123 | return _file->curPosition(); 124 | } 125 | 126 | uint32_t File::size() { 127 | if (! _file) return 0; 128 | return _file->fileSize(); 129 | } 130 | 131 | void File::close() { 132 | if (_file) { 133 | _file->close(); 134 | free(_file); 135 | _file = 0; 136 | 137 | /* for debugging file open/close leaks 138 | nfilecount--; 139 | Serial.print("Deleted "); 140 | Serial.println(nfilecount, DEC); 141 | */ 142 | } 143 | } 144 | 145 | File::operator bool() { 146 | if (_file) 147 | return _file->isOpen(); 148 | return false; 149 | } 150 | 151 | -------------------------------------------------------------------------------- /libraries/SPFD5408 libraries/SPFD5408_TFT_Library/src/TftSpfd5408.h: -------------------------------------------------------------------------------- 1 | // IMPORTANT: SEE COMMENTS @ LINE 15 REGARDING SHIELD VS BREAKOUT BOARD USAGE. 2 | 3 | // Graphics library by ladyada/adafruit with init code from Rossum 4 | // MIT license 5 | 6 | #ifndef _ADAFRUIT_TFTLCD_H_ 7 | #define _ADAFRUIT_TFTLCD_H_ 8 | 9 | #if ARDUINO >= 100 10 | #include "Arduino.h" 11 | #else 12 | #include "WProgram.h" 13 | #endif 14 | 15 | #include 16 | 17 | // **** IF USING THE LCD BREAKOUT BOARD, COMMENT OUT THIS NEXT LINE. **** 18 | // **** IF USING THE LCD SHIELD, LEAVE THE LINE ENABLED: **** 19 | 20 | //#define USE_ADAFRUIT_SHIELD_PINOUT 1 21 | 22 | class TftSpfd5408 : public Adafruit_GFX { 23 | 24 | public: 25 | 26 | TftSpfd5408(uint8_t cs, uint8_t cd, uint8_t wr, uint8_t rd, uint8_t rst); 27 | TftSpfd5408(void); 28 | 29 | void begin(uint16_t id = 0x9325); 30 | void drawPixel(int16_t x, int16_t y, uint16_t color); 31 | void drawFastHLine(int16_t x0, int16_t y0, int16_t w, uint16_t color); 32 | void drawFastVLine(int16_t x0, int16_t y0, int16_t h, uint16_t color); 33 | void fillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t c); 34 | void fillScreen(uint16_t color); 35 | void reset(void); 36 | void setRegisters8(uint8_t *ptr, uint8_t n); 37 | void setRegisters16(uint16_t *ptr, uint8_t n); 38 | void setRotation(uint8_t x); 39 | // These methods are public in order for BMP examples to work: 40 | void setAddrWindow(int x1, int y1, int x2, int y2); 41 | void pushColors(uint16_t *data, uint8_t len, boolean first); 42 | 43 | uint16_t color565(uint8_t r, uint8_t g, uint8_t b), 44 | readPixel(int16_t x, int16_t y), 45 | readID(void); 46 | uint32_t readReg(uint8_t r); 47 | 48 | private: 49 | 50 | void init(), 51 | // These items may have previously been defined as macros 52 | // in pin_magic.h. If not, function versions are declared: 53 | #ifndef write8 54 | write8(uint8_t value), 55 | #endif 56 | #ifndef setWriteDir 57 | setWriteDir(void), 58 | #endif 59 | #ifndef setReadDir 60 | setReadDir(void), 61 | #endif 62 | #ifndef writeRegister8 63 | writeRegister8(uint8_t a, uint8_t d), 64 | #endif 65 | #ifndef writeRegister16 66 | writeRegister16(uint16_t a, uint16_t d), 67 | #endif 68 | writeRegister24(uint8_t a, uint32_t d), 69 | writeRegister32(uint8_t a, uint32_t d), 70 | #ifndef writeRegisterPair 71 | writeRegisterPair(uint8_t aH, uint8_t aL, uint16_t d), 72 | #endif 73 | setLR(void), 74 | flood(uint16_t color, uint32_t len); 75 | uint8_t driver; 76 | 77 | #ifndef read8 78 | uint8_t read8fn(void); 79 | #define read8isFunctionalized 80 | #endif 81 | 82 | #ifndef USE_ADAFRUIT_SHIELD_PINOUT 83 | 84 | #ifdef __AVR__ 85 | volatile uint8_t *csPort , *cdPort , *wrPort , *rdPort; 86 | uint8_t csPinSet , cdPinSet , wrPinSet , rdPinSet , 87 | csPinUnset, cdPinUnset, wrPinUnset, rdPinUnset, 88 | _reset; 89 | #endif 90 | #if defined(__SAM3X8E__) 91 | Pio *csPort , *cdPort , *wrPort , *rdPort; 92 | uint32_t csPinSet , cdPinSet , wrPinSet , rdPinSet , 93 | csPinUnset, cdPinUnset, wrPinUnset, rdPinUnset, 94 | _reset; 95 | #endif 96 | 97 | #endif 98 | }; 99 | 100 | // For compatibility with sketches written for older versions of library. 101 | // Color function name was changed to 'color565' for parity with 2.2" LCD 102 | // library. 103 | #define Color565 color565 104 | 105 | #endif 106 | -------------------------------------------------------------------------------- /libraries/Adafruit libraries/Adafruit_TFTLCD/Adafruit_TFTLCD.h: -------------------------------------------------------------------------------- 1 | // IMPORTANT: SEE COMMENTS @ LINE 15 REGARDING SHIELD VS BREAKOUT BOARD USAGE. 2 | 3 | // Graphics library by ladyada/adafruit with init code from Rossum 4 | // MIT license 5 | 6 | #ifndef _ADAFRUIT_TFTLCD_H_ 7 | #define _ADAFRUIT_TFTLCD_H_ 8 | 9 | #if ARDUINO >= 100 10 | #include "Arduino.h" 11 | #else 12 | #include "WProgram.h" 13 | #endif 14 | 15 | #include 16 | 17 | // **** IF USING THE LCD BREAKOUT BOARD, COMMENT OUT THIS NEXT LINE. **** 18 | // **** IF USING THE LCD SHIELD, LEAVE THE LINE ENABLED: **** 19 | 20 | //#define USE_ADAFRUIT_SHIELD_PINOUT 1 21 | 22 | class Adafruit_TFTLCD : public Adafruit_GFX { 23 | 24 | public: 25 | 26 | Adafruit_TFTLCD(uint8_t cs, uint8_t cd, uint8_t wr, uint8_t rd, uint8_t rst); 27 | Adafruit_TFTLCD(void); 28 | 29 | void begin(uint16_t id = 0x9325); 30 | void drawPixel(int16_t x, int16_t y, uint16_t color); 31 | void drawFastHLine(int16_t x0, int16_t y0, int16_t w, uint16_t color); 32 | void drawFastVLine(int16_t x0, int16_t y0, int16_t h, uint16_t color); 33 | void fillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t c); 34 | void fillScreen(uint16_t color); 35 | void reset(void); 36 | void setRegisters8(uint8_t *ptr, uint8_t n); 37 | void setRegisters16(uint16_t *ptr, uint8_t n); 38 | void setRotation(uint8_t x); 39 | // These methods are public in order for BMP examples to work: 40 | void setAddrWindow(int x1, int y1, int x2, int y2); 41 | void pushColors(uint16_t *data, uint8_t len, boolean first); 42 | 43 | uint16_t color565(uint8_t r, uint8_t g, uint8_t b), 44 | readPixel(int16_t x, int16_t y), 45 | readID(void); 46 | uint32_t readReg(uint8_t r); 47 | 48 | private: 49 | 50 | void init(), 51 | // These items may have previously been defined as macros 52 | // in pin_magic.h. If not, function versions are declared: 53 | #ifndef write8 54 | write8(uint8_t value), 55 | #endif 56 | #ifndef setWriteDir 57 | setWriteDir(void), 58 | #endif 59 | #ifndef setReadDir 60 | setReadDir(void), 61 | #endif 62 | #ifndef writeRegister8 63 | writeRegister8(uint8_t a, uint8_t d), 64 | #endif 65 | #ifndef writeRegister16 66 | writeRegister16(uint16_t a, uint16_t d), 67 | #endif 68 | writeRegister24(uint8_t a, uint32_t d), 69 | writeRegister32(uint8_t a, uint32_t d), 70 | #ifndef writeRegisterPair 71 | writeRegisterPair(uint8_t aH, uint8_t aL, uint16_t d), 72 | #endif 73 | setLR(void), 74 | flood(uint16_t color, uint32_t len); 75 | uint8_t driver; 76 | 77 | #ifndef read8 78 | uint8_t read8fn(void); 79 | #define read8isFunctionalized 80 | #endif 81 | 82 | #ifndef USE_ADAFRUIT_SHIELD_PINOUT 83 | 84 | #ifdef __AVR__ 85 | volatile uint8_t *csPort , *cdPort , *wrPort , *rdPort; 86 | uint8_t csPinSet , cdPinSet , wrPinSet , rdPinSet , 87 | csPinUnset, cdPinUnset, wrPinUnset, rdPinUnset, 88 | _reset; 89 | #endif 90 | #if defined(__SAM3X8E__) 91 | Pio *csPort , *cdPort , *wrPort , *rdPort; 92 | uint32_t csPinSet , cdPinSet , wrPinSet , rdPinSet , 93 | csPinUnset, cdPinUnset, wrPinUnset, rdPinUnset, 94 | _reset; 95 | #endif 96 | 97 | #endif 98 | }; 99 | 100 | // For compatibility with sketches written for older versions of library. 101 | // Color function name was changed to 'color565' for parity with 2.2" LCD 102 | // library. 103 | #define Color565 color565 104 | 105 | #endif 106 | -------------------------------------------------------------------------------- /libraries/SD library/SD/SD.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | SD - a slightly more friendly wrapper for sdfatlib 4 | 5 | This library aims to expose a subset of SD card functionality 6 | in the form of a higher level "wrapper" object. 7 | 8 | License: GNU General Public License V3 9 | (Because sdfatlib is licensed with this.) 10 | 11 | (C) Copyright 2010 SparkFun Electronics 12 | 13 | */ 14 | 15 | #ifndef __SD_H__ 16 | #define __SD_H__ 17 | 18 | #if ARDUINO >= 100 19 | #include "Arduino.h" 20 | #else 21 | #include "WProgram.h" 22 | #endif 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | #define FILE_READ O_READ 29 | #define FILE_WRITE (O_READ | O_WRITE | O_CREAT) 30 | 31 | class File : public Stream { 32 | private: 33 | char _name[13]; // our name 34 | SdFile *_file; // underlying file pointer 35 | 36 | public: 37 | File(SdFile f, const char *name); // wraps an underlying SdFile 38 | File(void); // 'empty' constructor 39 | ~File(void); // destructor 40 | #if ARDUINO >= 100 41 | virtual size_t write(uint8_t); 42 | virtual size_t write(const uint8_t *buf, size_t size); 43 | #else 44 | virtual void write(uint8_t); 45 | virtual void write(const uint8_t *buf, size_t size); 46 | #endif 47 | virtual int read(); 48 | virtual int peek(); 49 | virtual int available(); 50 | virtual void flush(); 51 | int read(void *buf, uint16_t nbyte); 52 | boolean seek(uint32_t pos); 53 | uint32_t position(); 54 | uint32_t size(); 55 | void close(); 56 | operator bool(); 57 | char * name(); 58 | 59 | boolean isDirectory(void); 60 | File openNextFile(uint8_t mode = O_RDONLY); 61 | void rewindDirectory(void); 62 | 63 | using Print::write; 64 | }; 65 | 66 | class SDClass { 67 | 68 | private: 69 | // These are required for initialisation and use of sdfatlib 70 | Sd2Card card; 71 | SdVolume volume; 72 | SdFile root; 73 | 74 | // my quick&dirty iterator, should be replaced 75 | SdFile getParentDir(const char *filepath, int *indx); 76 | public: 77 | // This needs to be called to set up the connection to the SD card 78 | // before other methods are used. 79 | boolean begin(uint8_t csPin = SD_CHIP_SELECT_PIN, int8_t mosi = -1, int8_t miso = -1, int8_t sck = -1); 80 | 81 | //call this when a card is removed. It will allow you to inster and initialise a new card. 82 | void end(); 83 | 84 | // Open the specified file/directory with the supplied mode (e.g. read or 85 | // write, etc). Returns a File object for interacting with the file. 86 | // Note that currently only one file can be open at a time. 87 | File open(const char *filename, uint8_t mode = FILE_READ); 88 | 89 | // Methods to determine if the requested file path exists. 90 | boolean exists(char *filepath); 91 | 92 | // Create the requested directory heirarchy--if intermediate directories 93 | // do not exist they will be created. 94 | boolean mkdir(char *filepath); 95 | 96 | // Delete the file. 97 | boolean remove(char *filepath); 98 | 99 | boolean rmdir(char *filepath); 100 | 101 | void enableCRC(boolean mode); 102 | 103 | private: 104 | 105 | // This is used to determine the mode used to open a file 106 | // it's here because it's the easiest place to pass the 107 | // information through the directory walking function. But 108 | // it's probably not the best place for it. 109 | // It shouldn't be set directly--it is set via the parameters to `open`. 110 | int fileOpenMode; 111 | 112 | friend class File; 113 | friend boolean callback_openPath(SdFile&, char *, boolean, void *); 114 | }; 115 | 116 | extern SDClass SD; 117 | 118 | #endif 119 | -------------------------------------------------------------------------------- /libraries/Kicksort library/KickSort/examples/EXAMPLE04_CombSort/EXAMPLE04_CombSort.ino: -------------------------------------------------------------------------------- 1 | /* 2 | * FILENAME: EXAMPLE04_CombSort.ino 3 | * AUTHOR: Orlando S. Hoilett 4 | * CONTACT: orlandohoilett@gmail.com 5 | * VERSION: 1.1.0 6 | * 7 | * 8 | * AFFILIATIONS 9 | * Linnes Lab, Weldon School of Biomedical Engineering, 10 | * Purdue University, West Lafayette, IN 47907 11 | * 12 | * 13 | * DESCRIPTION 14 | * Basic test of the KickSort class to evaluate combSort function. 15 | * 16 | * This library is built from aggregating and modifying different sorting 17 | * implementations from various other GitHub users including: robtillaart 18 | * (especially), emilv, luisllamasbinaburo, and dndubins. Thanks! 19 | * 20 | * 21 | * UPDATES 22 | * Version 1.0.0 23 | * 2020/08/22:2000> (UTC-5) 24 | * - Initiated. 25 | * Version 1.1.0 26 | * 2020/08/26:2335> (UTC-5) 27 | * - Updated comments. 28 | * 29 | * 30 | * DISCLAIMER 31 | * Linnes Lab code, firmware, and software is released under the 32 | * MIT License (http://opensource.org/licenses/MIT). 33 | * 34 | * The MIT License (MIT) 35 | * 36 | * Copyright (c) 2020 Linnes Lab, Purdue University 37 | * 38 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 39 | * this software and associated documentation files (the "Software"), to deal in 40 | * the Software without restriction, including without limitation the rights to 41 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 42 | * of the Software, and to permit persons to whom the Software is furnished to do 43 | * so, subject to the following conditions: 44 | * 45 | * The above copyright notice and this permission notice shall be included in all 46 | * copies or substantial portions of the Software. 47 | * 48 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 49 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 50 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 51 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 52 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 53 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 54 | * SOFTWARE. 55 | * 56 | */ 57 | 58 | 59 | #include "KickSort.h" 60 | 61 | 62 | const uint16_t samples = 100; 63 | //input array from 1 to 100 64 | uint16_t input[samples] = { 3, 53, 70, 56, 18, 85, 27, 14, 37, 94, 9, 55, 40, 60, 52, 61, 15, 65, 13, 8, 57, 97, 69, 4, 35, 82, 22, 73, 59, 68, 78, 24, 21, 36, 71, 80, 74, 39, 17, 12, 29, 76, 49, 51, 30, 90, 88, 2, 84, 50, 62, 28, 77, 43, 5, 16, 58, 26, 32, 34, 1, 75, 66, 95, 38, 89, 67, 87, 100, 54, 92, 81, 25, 83, 46, 33, 23, 45, 96, 99, 79, 48, 11, 31, 7, 6, 19, 91, 93, 44, 47, 98, 86, 41, 63, 20, 72, 10, 42, 64 }; 65 | 66 | 67 | void setup() 68 | { 69 | Serial.begin(9600); 70 | while(!Serial); //holds the program until the Serial Monitor is opened 71 | 72 | 73 | Serial.println("CombSort Ascending"); 74 | KickSort::combSort(input, samples); 75 | 76 | //print the sorted array 77 | for(uint16_t i = 0; i < samples; i++) 78 | { 79 | Serial.print(i); 80 | Serial.print(": "); 81 | Serial.println(input[i]); 82 | } 83 | Serial.println(); 84 | Serial.println(); 85 | 86 | 87 | Serial.println("CombSort Descending"); 88 | KickSort::combSort(input, samples, KickSort_Dir::DESCENDING); 89 | 90 | //print the sorted array 91 | for(uint16_t i = 0; i < samples; i++) 92 | { 93 | Serial.print(i); 94 | Serial.print(": "); 95 | Serial.println(input[i]); 96 | } 97 | Serial.println(); 98 | Serial.println(); 99 | 100 | } 101 | 102 | void loop() 103 | { 104 | } 105 | -------------------------------------------------------------------------------- /libraries/Kicksort library/KickSort/examples/EXAMPLE05_ShellSort/EXAMPLE05_ShellSort.ino: -------------------------------------------------------------------------------- 1 | /* 2 | * FILENAME: EXAMPLE05_ShellSort.ino 3 | * AUTHOR: Orlando S. Hoilett 4 | * CONTACT: orlandohoilett@gmail.com 5 | * VERSION: 1.1.0 6 | * 7 | * 8 | * AFFILIATIONS 9 | * Linnes Lab, Weldon School of Biomedical Engineering, 10 | * Purdue University, West Lafayette, IN 47907 11 | * 12 | * 13 | * DESCRIPTION 14 | * Basic test of the KickSort class to evaluate shellSort function. 15 | * 16 | * This library is built from aggregating and modifying different sorting 17 | * implementations from various other GitHub users including: robtillaart 18 | * (especially), emilv, luisllamasbinaburo, and dndubins. Thanks! 19 | * 20 | * 21 | * UPDATES 22 | * Version 1.0.0 23 | * 2020/08/22:2000> (UTC-5) 24 | * - Initiated. 25 | * Version 1.1.0 26 | * 2020/08/26:2335> (UTC-5) 27 | * - Updated comments. 28 | * 29 | * 30 | * DISCLAIMER 31 | * Linnes Lab code, firmware, and software is released under the 32 | * MIT License (http://opensource.org/licenses/MIT). 33 | * 34 | * The MIT License (MIT) 35 | * 36 | * Copyright (c) 2020 Linnes Lab, Purdue University 37 | * 38 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 39 | * this software and associated documentation files (the "Software"), to deal in 40 | * the Software without restriction, including without limitation the rights to 41 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 42 | * of the Software, and to permit persons to whom the Software is furnished to do 43 | * so, subject to the following conditions: 44 | * 45 | * The above copyright notice and this permission notice shall be included in all 46 | * copies or substantial portions of the Software. 47 | * 48 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 49 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 50 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 51 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 52 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 53 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 54 | * SOFTWARE. 55 | * 56 | */ 57 | 58 | 59 | #include "KickSort.h" 60 | 61 | 62 | const uint16_t samples = 100; 63 | //input array from 1 to 100 64 | uint16_t input[samples] = { 3, 53, 70, 56, 18, 85, 27, 14, 37, 94, 9, 55, 40, 60, 52, 61, 15, 65, 13, 8, 57, 97, 69, 4, 35, 82, 22, 73, 59, 68, 78, 24, 21, 36, 71, 80, 74, 39, 17, 12, 29, 76, 49, 51, 30, 90, 88, 2, 84, 50, 62, 28, 77, 43, 5, 16, 58, 26, 32, 34, 1, 75, 66, 95, 38, 89, 67, 87, 100, 54, 92, 81, 25, 83, 46, 33, 23, 45, 96, 99, 79, 48, 11, 31, 7, 6, 19, 91, 93, 44, 47, 98, 86, 41, 63, 20, 72, 10, 42, 64 }; 65 | 66 | 67 | void setup() 68 | { 69 | Serial.begin(9600); 70 | while(!Serial); //holds the program until the Serial Monitor is opened 71 | 72 | 73 | Serial.println("ShellSort Ascending"); 74 | KickSort::shellSort(input, samples); 75 | 76 | //print the sorted array 77 | for(uint16_t i = 0; i < samples; i++) 78 | { 79 | Serial.print(i); 80 | Serial.print(": "); 81 | Serial.println(input[i]); 82 | } 83 | Serial.println(); 84 | Serial.println(); 85 | 86 | 87 | Serial.println("ShellSort Descending"); 88 | KickSort::shellSort(input, samples, KickSort_Dir::DESCENDING); 89 | 90 | //print the sorted array 91 | for(uint16_t i = 0; i < samples; i++) 92 | { 93 | Serial.print(i); 94 | Serial.print(": "); 95 | Serial.println(input[i]); 96 | } 97 | Serial.println(); 98 | Serial.println(); 99 | 100 | } 101 | 102 | void loop() 103 | { 104 | } 105 | -------------------------------------------------------------------------------- /libraries/Kicksort library/KickSort/examples/EXAMPLE02_BubbleSort/EXAMPLE02_BubbleSort.ino: -------------------------------------------------------------------------------- 1 | /* 2 | * FILENAME: EXAMPLE02_BubbleSort.ino 3 | * AUTHOR: Orlando S. Hoilett 4 | * CONTACT: orlandohoilett@gmail.com 5 | * VERSION: 1.1.0 6 | * 7 | * 8 | * AFFILIATIONS 9 | * Linnes Lab, Weldon School of Biomedical Engineering, 10 | * Purdue University, West Lafayette, IN 47907 11 | * 12 | * 13 | * DESCRIPTION 14 | * Basic test of the KickSort class to evaluate bubbleSort function. 15 | * 16 | * This library is built from aggregating and modifying different sorting 17 | * implementations from various other GitHub users including: robtillaart 18 | * (especially), emilv, luisllamasbinaburo, and dndubins. Thanks! 19 | * 20 | * 21 | * UPDATES 22 | * Version 1.0.0 23 | * 2020/08/22:2000> (UTC-5) 24 | * - Initiated. 25 | * Version 1.1.0 26 | * 2020/08/26:2335> (UTC-5) 27 | * - Updated comments. 28 | * 29 | * 30 | * DISCLAIMER 31 | * Linnes Lab code, firmware, and software is released under the 32 | * MIT License (http://opensource.org/licenses/MIT). 33 | * 34 | * The MIT License (MIT) 35 | * 36 | * Copyright (c) 2020 Linnes Lab, Purdue University 37 | * 38 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 39 | * this software and associated documentation files (the "Software"), to deal in 40 | * the Software without restriction, including without limitation the rights to 41 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 42 | * of the Software, and to permit persons to whom the Software is furnished to do 43 | * so, subject to the following conditions: 44 | * 45 | * The above copyright notice and this permission notice shall be included in all 46 | * copies or substantial portions of the Software. 47 | * 48 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 49 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 50 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 51 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 52 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 53 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 54 | * SOFTWARE. 55 | * 56 | */ 57 | 58 | 59 | #include "KickSort.h" 60 | 61 | 62 | const uint16_t samples = 100; 63 | //input array from 1 to 100 64 | uint16_t input[samples] = { 3, 53, 70, 56, 18, 85, 27, 14, 37, 94, 9, 55, 40, 60, 52, 61, 15, 65, 13, 8, 57, 97, 69, 4, 35, 82, 22, 73, 59, 68, 78, 24, 21, 36, 71, 80, 74, 39, 17, 12, 29, 76, 49, 51, 30, 90, 88, 2, 84, 50, 62, 28, 77, 43, 5, 16, 58, 26, 32, 34, 1, 75, 66, 95, 38, 89, 67, 87, 100, 54, 92, 81, 25, 83, 46, 33, 23, 45, 96, 99, 79, 48, 11, 31, 7, 6, 19, 91, 93, 44, 47, 98, 86, 41, 63, 20, 72, 10, 42, 64 }; 65 | 66 | 67 | void setup() 68 | { 69 | Serial.begin(9600); 70 | while(!Serial); //holds the program until the Serial Monitor is opened 71 | 72 | 73 | Serial.println("BubbleSort Descending"); 74 | KickSort::bubbleSort(input, samples, KickSort_Dir::DESCENDING); 75 | 76 | //print the sorted array 77 | for(uint16_t i = 0; i < samples; i++) 78 | { 79 | Serial.print(i); 80 | Serial.print(": "); 81 | Serial.println(input[i]); 82 | } 83 | Serial.println(); 84 | Serial.println(); 85 | 86 | 87 | Serial.println("BubbleSort Ascending"); 88 | KickSort::bubbleSort(input, samples); 89 | 90 | //print the sorted array 91 | for(uint16_t i = 0; i < samples; i++) 92 | { 93 | Serial.print(i); 94 | Serial.print(": "); 95 | Serial.println(input[i]); 96 | } 97 | Serial.println(); 98 | Serial.println(); 99 | 100 | } 101 | 102 | void loop() 103 | { 104 | } 105 | -------------------------------------------------------------------------------- /libraries/Kicksort library/KickSort/examples/EXAMPLE03_InsertionSort/EXAMPLE03_InsertionSort.ino: -------------------------------------------------------------------------------- 1 | /* 2 | * FILENAME: EXAMPLE03_InsertionSort.ino 3 | * AUTHOR: Orlando S. Hoilett 4 | * CONTACT: orlandohoilett@gmail.com 5 | * VERSION: 1.1.0 6 | * 7 | * 8 | * AFFILIATIONS 9 | * Linnes Lab, Weldon School of Biomedical Engineering, 10 | * Purdue University, West Lafayette, IN 47907 11 | * 12 | * 13 | * DESCRIPTION 14 | * Basic test of the KickSort class to evaluate insertionSort function. 15 | * 16 | * This library is built from aggregating and modifying different sorting 17 | * implementations from various other GitHub users including: robtillaart 18 | * (especially), emilv, luisllamasbinaburo, and dndubins. Thanks! 19 | * 20 | * 21 | * UPDATES 22 | * Version 1.0.0 23 | * 2020/08/22:2000> (UTC-5) 24 | * - Initiated. 25 | * Version 1.1.0 26 | * 2020/08/26:2335> (UTC-5) 27 | * - Updated comments. 28 | * 29 | * 30 | * DISCLAIMER 31 | * Linnes Lab code, firmware, and software is released under the 32 | * MIT License (http://opensource.org/licenses/MIT). 33 | * 34 | * The MIT License (MIT) 35 | * 36 | * Copyright (c) 2020 Linnes Lab, Purdue University 37 | * 38 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 39 | * this software and associated documentation files (the "Software"), to deal in 40 | * the Software without restriction, including without limitation the rights to 41 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 42 | * of the Software, and to permit persons to whom the Software is furnished to do 43 | * so, subject to the following conditions: 44 | * 45 | * The above copyright notice and this permission notice shall be included in all 46 | * copies or substantial portions of the Software. 47 | * 48 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 49 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 50 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 51 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 52 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 53 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 54 | * SOFTWARE. 55 | * 56 | */ 57 | 58 | 59 | #include "KickSort.h" 60 | 61 | 62 | const uint16_t samples = 100; 63 | //input array from 1 to 100 64 | uint16_t input[samples] = { 3, 53, 70, 56, 18, 85, 27, 14, 37, 94, 9, 55, 40, 60, 52, 61, 15, 65, 13, 8, 57, 97, 69, 4, 35, 82, 22, 73, 59, 68, 78, 24, 21, 36, 71, 80, 74, 39, 17, 12, 29, 76, 49, 51, 30, 90, 88, 2, 84, 50, 62, 28, 77, 43, 5, 16, 58, 26, 32, 34, 1, 75, 66, 95, 38, 89, 67, 87, 100, 54, 92, 81, 25, 83, 46, 33, 23, 45, 96, 99, 79, 48, 11, 31, 7, 6, 19, 91, 93, 44, 47, 98, 86, 41, 63, 20, 72, 10, 42, 64 }; 65 | 66 | 67 | void setup() 68 | { 69 | Serial.begin(9600); 70 | while(!Serial); //holds the program until the Serial Monitor is opened 71 | 72 | 73 | Serial.println("InsertionSort Ascending"); 74 | KickSort::insertionSort(input, samples); 75 | 76 | //print the sorted array 77 | for(uint16_t i = 0; i < samples; i++) 78 | { 79 | Serial.print(i); 80 | Serial.print(": "); 81 | Serial.println(input[i]); 82 | } 83 | Serial.println(); 84 | Serial.println(); 85 | 86 | 87 | Serial.println("InsertionSort Descending"); 88 | KickSort::insertionSort(input, samples, KickSort_Dir::DESCENDING); 89 | 90 | //print the sorted array 91 | for(uint16_t i = 0; i < samples; i++) 92 | { 93 | Serial.print(i); 94 | Serial.print(": "); 95 | Serial.println(input[i]); 96 | } 97 | Serial.println(); 98 | Serial.println(); 99 | 100 | } 101 | 102 | void loop() 103 | { 104 | } 105 | -------------------------------------------------------------------------------- /libraries/SPFD5408 libraries/SPFD5408/fontconvert/fontconvert_win.md: -------------------------------------------------------------------------------- 1 | ### A short guide to use fontconvert.c to create your own fonts using MinGW. 2 | 3 | #### STEP 1: INSTALL MinGW 4 | 5 | Install MinGW (Minimalist GNU for Windows) from [MinGW.org](http://www.mingw.org/). 6 | Please read carefully the instructions found on [Getting started page](http://www.mingw.org/wiki/Getting_Started). 7 | I suggest installing with the "Graphical User Interface Installer". 8 | To complete your initial installation you should further install some "packages". 9 | For our purpose you should only install the "Basic Setup" packages. 10 | To do that: 11 | 12 | 1. Open the MinGW Installation Manager 13 | 2. From the left panel click "Basic Setup". 14 | 3. On the right panel choose "mingw32-base", "mingw-gcc-g++", "mingw-gcc-objc" and "msys-base" 15 | and click "Mark for installation" 16 | 4. From the Menu click "Installation" and then "Apply changes". In the pop-up window select "Apply". 17 | 18 | 19 | #### STEP 2: INSTALL Freetype Library 20 | 21 | To read about the freetype project visit [freetype.org](https://www.freetype.org/). 22 | To Download the latest version of freetype go to [download page](http://download.savannah.gnu.org/releases/freetype/) 23 | and choose "freetype-2.7.tar.gz" file (or a newer version if available). 24 | To avoid long cd commands later in the command prompt, I suggest you unzip the file in the C:\ directory. 25 | (I also renamed the folder to "ft27") 26 | Before you build the library it's good to read these articles: 27 | * [Using MSYS with MinGW](http://www.mingw.org/wiki/MSYS) 28 | * [Installation and Use of Supplementary Libraries with MinGW](http://www.mingw.org/wiki/LibraryPathHOWTO) 29 | * [Include Path](http://www.mingw.org/wiki/IncludePathHOWTO) 30 | 31 | Inside the unzipped folder there is another folder named "docs". Open it and read the INSTALL.UNIX (using notepad). 32 | Pay attention to paragraph 3 (Build and Install the Library). So, let's begin the installation. 33 | To give the appropriate commands we will use the MSYS command prompt (not cmd.exe of windows) which is UNIX like. 34 | Follow the path C:\MinGW\msys\1.0 and double click "msys.bat". The command prompt environment appears. 35 | Enter "ft27" directory using the cd commands: 36 | ``` 37 | cd /c 38 | cd ft27 39 | ``` 40 | 41 | and then type one by one the commands: 42 | ``` 43 | ./configure --prefix=/mingw 44 | make 45 | make install 46 | ``` 47 | Once you're finished, go inside "C:\MinGW\include" and there should be a new folder named "freetype2". 48 | That, hopefully, means that you have installed the library correctly !! 49 | 50 | #### STEP 3: Build fontconvert.c 51 | 52 | Before proceeding I suggest you make a copy of Adafruit_GFX_library folder in C:\ directory. 53 | Then, inside "fontconvert" folder open the "makefile" with an editor ( I used notepad++). 54 | Change the commands so in the end the program looks like : 55 | ``` 56 | all: fontconvert 57 | 58 | CC = gcc 59 | CFLAGS = -Wall -I c:/mingw/include/freetype2 60 | LIBS = -lfreetype 61 | 62 | fontconvert: fontconvert.c 63 | $(CC) $(CFLAGS) $< $(LIBS) -o $@ 64 | 65 | clean: 66 | rm -f fontconvert 67 | ``` 68 | Go back in the command prompt and with a cd command enter the fontconvert directory. 69 | ``` 70 | cd /c/adafruit_gfx_library\fontconvert 71 | ``` 72 | Give the command: 73 | ``` 74 | make 75 | ``` 76 | This command will, eventually, create a "fontconvert.exe" file inside fontconvert directory. 77 | 78 | #### STEP 4: Create your own font header files 79 | 80 | Now that you have an executable file, you can use it to create your own fonts to work with Adafruit GFX lib. 81 | So, if we suppose that you already have a .ttf file with your favorite fonts, jump to the command prompt and type: 82 | ``` 83 | ./fontconvert yourfonts.ttf 9 > yourfonts9pt7b.h 84 | ``` 85 | You can read more details at: [learn.adafruit](https://learn.adafruit.com/adafruit-gfx-graphics-library/using-fonts). 86 | 87 | Taraaaaaammm !! you've just created your new font header file. Put it inside the "Fonts" folder, grab a cup of coffee 88 | and start playing with your Arduino (or whatever else ....)+ display module project. 89 | -------------------------------------------------------------------------------- /libraries/Kicksort library/KickSort/examples/EXAMPLE01_QuickSort/EXAMPLE01_QuickSort.ino: -------------------------------------------------------------------------------- 1 | /* 2 | * FILENAME: EXAMPLE01_QuickSort.ino 3 | * AUTHOR: Orlando S. Hoilett 4 | * CONTACT: orlandohoilett@gmail.com 5 | * VERSION: 1.1.0 6 | * 7 | * 8 | * AFFILIATIONS 9 | * Linnes Lab, Weldon School of Biomedical Engineering, 10 | * Purdue University, West Lafayette, IN 47907 11 | * 12 | * 13 | * DESCRIPTION 14 | * Basic test of the KickSort class to evaluate quickSort function. 15 | * 16 | * This library is built from aggregating and modifying different sorting 17 | * implementations from various other GitHub users including: robtillaart 18 | * (especially), emilv, luisllamasbinaburo, and dndubins. Thanks! 19 | * 20 | * 21 | * UPDATES 22 | * Version 1.0.0 23 | * 2020/08/22:2000> (UTC-5) 24 | * - Initiated. 25 | * Version 1.1.0 26 | * 2020/08/26:2335> (UTC-5) 27 | * - Updated comments. 28 | * 29 | * 30 | * DISCLAIMER 31 | * Linnes Lab code, firmware, and software is released under the 32 | * MIT License (http://opensource.org/licenses/MIT). 33 | * 34 | * The MIT License (MIT) 35 | * 36 | * Copyright (c) 2020 Linnes Lab, Purdue University 37 | * 38 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 39 | * this software and associated documentation files (the "Software"), to deal in 40 | * the Software without restriction, including without limitation the rights to 41 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 42 | * of the Software, and to permit persons to whom the Software is furnished to do 43 | * so, subject to the following conditions: 44 | * 45 | * The above copyright notice and this permission notice shall be included in all 46 | * copies or substantial portions of the Software. 47 | * 48 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 49 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 50 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 51 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 52 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 53 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 54 | * SOFTWARE. 55 | * 56 | */ 57 | 58 | 59 | #include "KickSort.h" 60 | 61 | #if defined(ARDUINO_ARCH_SAMD) 62 | #define SerialDebugger SerialUSB 63 | #else 64 | #define SerialDebugger Serial 65 | #endif 66 | 67 | 68 | const uint16_t samples = 100; 69 | //input array from 1 to 100 70 | uint16_t input[samples] = { 3, 53, 70, 56, 18, 85, 27, 14, 37, 94, 9, 55, 40, 60, 52, 61, 15, 65, 13, 8, 57, 97, 69, 4, 35, 82, 22, 73, 59, 68, 78, 24, 21, 36, 71, 80, 74, 39, 17, 12, 29, 76, 49, 51, 30, 90, 88, 2, 84, 50, 62, 28, 77, 43, 5, 16, 58, 26, 32, 34, 1, 75, 66, 95, 38, 89, 67, 87, 100, 54, 92, 81, 25, 83, 46, 33, 23, 45, 96, 99, 79, 48, 11, 31, 7, 6, 19, 91, 93, 44, 47, 98, 86, 41, 63, 20, 72, 10, 42, 64 }; 71 | 72 | 73 | void setup() 74 | { 75 | SerialDebugger.begin(9600); 76 | while(!SerialDebugger); //holds the program until Serial Monitor is opened 77 | 78 | 79 | SerialDebugger.println("QuickSort Descending"); 80 | KickSort::quickSort(input, samples, KickSort_Dir::DESCENDING); 81 | 82 | //print the sorted array 83 | for(uint16_t i = 0; i < samples; i++) 84 | { 85 | SerialDebugger.print(i); 86 | SerialDebugger.print(": "); 87 | SerialDebugger.println(input[i]); 88 | } 89 | SerialDebugger.println(); 90 | SerialDebugger.println(); 91 | 92 | 93 | SerialDebugger.println("QuickSort Ascending"); 94 | KickSort::quickSort(input, samples); 95 | 96 | //print the sorted array 97 | for(uint16_t i = 0; i < samples; i++) 98 | { 99 | SerialDebugger.print(i); 100 | SerialDebugger.print(": "); 101 | SerialDebugger.println(input[i]); 102 | } 103 | SerialDebugger.println(); 104 | SerialDebugger.println(); 105 | 106 | } 107 | 108 | void loop() 109 | { 110 | } 111 | -------------------------------------------------------------------------------- /libraries/Adafruit libraries/Adafruit_GFX_Library/fontconvert/fontconvert_win.md: -------------------------------------------------------------------------------- 1 | ### A short guide to use fontconvert.c to create your own fonts using MinGW. 2 | 3 | #### STEP 1: INSTALL MinGW 4 | 5 | Install MinGW (Minimalist GNU for Windows) from [MinGW.org](http://www.mingw.org/). 6 | Please read carefully the instructions found on [Getting started page](http://www.mingw.org/wiki/Getting_Started). 7 | I suggest installing with the "Graphical User Interface Installer". 8 | To complete your initial installation you should further install some "packages". 9 | For our purpose you should only install the "Basic Setup" packages. 10 | To do that: 11 | 12 | 1. Open the MinGW Installation Manager 13 | 2. From the left panel click "Basic Setup". 14 | 3. On the right panel choose "mingw32-base", "mingw-gcc-g++", "mingw-gcc-objc" and "msys-base" 15 | and click "Mark for installation" 16 | 4. From the Menu click "Installation" and then "Apply changes". In the pop-up window select "Apply". 17 | 18 | 19 | #### STEP 2: INSTALL Freetype Library 20 | 21 | To read about the freetype project visit [freetype.org](https://www.freetype.org/). 22 | To Download the latest version of freetype go to [download page](http://download.savannah.gnu.org/releases/freetype/) 23 | and choose "freetype-2.7.tar.gz" file (or a newer version if available). 24 | To avoid long cd commands later in the command prompt, I suggest you unzip the file in the C:\ directory. 25 | (I also renamed the folder to "ft27") 26 | Before you build the library it's good to read these articles: 27 | * [Using MSYS with MinGW](http://www.mingw.org/wiki/MSYS) 28 | * [Installation and Use of Supplementary Libraries with MinGW](http://www.mingw.org/wiki/LibraryPathHOWTO) 29 | * [Include Path](http://www.mingw.org/wiki/IncludePathHOWTO) 30 | 31 | Inside the unzipped folder there is another folder named "docs". Open it and read the INSTALL.UNIX (using notepad). 32 | Pay attention to paragraph 3 (Build and Install the Library). So, let's begin the installation. 33 | To give the appropriate commands we will use the MSYS command prompt (not cmd.exe of windows) which is UNIX like. 34 | Follow the path C:\MinGW\msys\1.0 and double click "msys.bat". The command prompt environment appears. 35 | Enter "ft27" directory using the cd commands: 36 | ``` 37 | cd /c 38 | cd ft27 39 | ``` 40 | 41 | and then type one by one the commands: 42 | ``` 43 | ./configure --prefix=/mingw 44 | make 45 | make install 46 | ``` 47 | Once you're finished, go inside "C:\MinGW\include" and there should be a new folder named "freetype2". 48 | That, hopefully, means that you have installed the library correctly !! 49 | 50 | #### STEP 3: Build fontconvert.c 51 | 52 | Before proceeding I suggest you make a copy of Adafruit_GFX_library folder in C:\ directory. 53 | Then, inside "fontconvert" folder open the "makefile" with an editor ( I used notepad++). 54 | Change the commands so in the end the program looks like : 55 | ``` 56 | all: fontconvert 57 | 58 | CC = gcc 59 | CFLAGS = -Wall -I c:/mingw/include/freetype2 60 | LIBS = -lfreetype 61 | 62 | fontconvert: fontconvert.c 63 | $(CC) $(CFLAGS) $< $(LIBS) -o $@ 64 | 65 | clean: 66 | rm -f fontconvert 67 | ``` 68 | Go back in the command prompt and with a cd command enter the fontconvert directory. 69 | ``` 70 | cd /c/adafruit_gfx_library\fontconvert 71 | ``` 72 | Give the command: 73 | ``` 74 | make 75 | ``` 76 | This command will, eventually, create a "fontconvert.exe" file inside fontconvert directory. 77 | 78 | #### STEP 4: Create your own font header files 79 | 80 | Now that you have an executable file, you can use it to create your own fonts to work with Adafruit GFX lib. 81 | So, if we suppose that you already have a .ttf file with your favorite fonts, jump to the command prompt and type: 82 | ``` 83 | ./fontconvert yourfonts.ttf 9 > yourfonts9pt7b.h 84 | ``` 85 | You can read more details at: [learn.adafruit](https://learn.adafruit.com/adafruit-gfx-graphics-library/using-fonts). 86 | 87 | Taraaaaaammm !! you've just created your new font header file. Put it inside the "Fonts" folder, grab a cup of coffee 88 | and start playing with your Arduino (or whatever else ....)+ display module project. 89 | -------------------------------------------------------------------------------- /libraries/SD library/SD/examples/CardInfo/CardInfo.ino: -------------------------------------------------------------------------------- 1 | /* 2 | SD card test 3 | 4 | This example shows how use the utility libraries on which the' 5 | SD library is based in order to get info about your SD card. 6 | Very useful for testing a card when you're not sure whether its working or not. 7 | 8 | The circuit: 9 | * SD card attached to SPI bus as follows: 10 | ** UNO: MOSI - pin 11, MISO - pin 12, CLK - pin 13, CS - pin 4 (CS pin can be changed) 11 | and pin #10 (SS) must be an output 12 | ** Mega: MOSI - pin 51, MISO - pin 50, CLK - pin 52, CS - pin 4 (CS pin can be changed) 13 | and pin #52 (SS) must be an output 14 | ** Leonardo: Connect to hardware SPI via the ICSP header 15 | Pin 4 used here for consistency with other Arduino examples 16 | 17 | 18 | created 28 Mar 2011 by Limor Fried 19 | modified 9 Apr 2012 by Tom Igoe 20 | */ 21 | // include the SD library: 22 | #include 23 | #include 24 | 25 | // set up variables using the SD utility library functions: 26 | Sd2Card card; 27 | SdVolume volume; 28 | SdFile root; 29 | 30 | // change this to match your SD shield or module; 31 | // Arduino Ethernet shield: pin 4 32 | // Adafruit SD shields and modules: pin 10 33 | // Sparkfun SD shield: pin 8 34 | const int chipSelect = 4; 35 | 36 | void setup() 37 | { 38 | // Open serial communications and wait for port to open: 39 | Serial.begin(9600); 40 | while (!Serial) { 41 | ; // wait for serial port to connect. Needed for Leonardo only 42 | } 43 | 44 | 45 | Serial.print("\nInitializing SD card..."); 46 | // On the Ethernet Shield, CS is pin 4. It's set as an output by default. 47 | // Note that even if it's not used as the CS pin, the hardware SS pin 48 | // (10 on most Arduino boards, 53 on the Mega) must be left as an output 49 | // or the SD library functions will not work. 50 | pinMode(SS, OUTPUT); 51 | 52 | 53 | // we'll use the initialization code from the utility libraries 54 | // since we're just testing if the card is working! 55 | while (!card.init(SPI_HALF_SPEED, chipSelect)) { 56 | Serial.println("initialization failed. Things to check:"); 57 | Serial.println("* is a card is inserted?"); 58 | Serial.println("* Is your wiring correct?"); 59 | Serial.println("* did you change the chipSelect pin to match your shield or module?"); 60 | } 61 | 62 | // print the type of card 63 | Serial.print("\nCard type: "); 64 | switch(card.type()) { 65 | case SD_CARD_TYPE_SD1: 66 | Serial.println("SD1"); 67 | break; 68 | case SD_CARD_TYPE_SD2: 69 | Serial.println("SD2"); 70 | break; 71 | case SD_CARD_TYPE_SDHC: 72 | Serial.println("SDHC"); 73 | break; 74 | default: 75 | Serial.println("Unknown"); 76 | } 77 | 78 | // Now we will try to open the 'volume'/'partition' - it should be FAT16 or FAT32 79 | if (!volume.init(card)) { 80 | Serial.println("Could not find FAT16/FAT32 partition.\nMake sure you've formatted the card"); 81 | return; 82 | } 83 | 84 | 85 | // print the type and size of the first FAT-type volume 86 | uint32_t volumesize; 87 | Serial.print("\nVolume type is FAT"); 88 | Serial.println(volume.fatType(), DEC); 89 | Serial.println(); 90 | 91 | volumesize = volume.blocksPerCluster(); // clusters are collections of blocks 92 | volumesize *= volume.clusterCount(); // we'll have a lot of clusters 93 | volumesize *= 512; // SD card blocks are always 512 bytes 94 | Serial.print("Volume size (bytes): "); 95 | Serial.println(volumesize); 96 | Serial.print("Volume size (Kbytes): "); 97 | volumesize /= 1024; 98 | Serial.println(volumesize); 99 | Serial.print("Volume size (Mbytes): "); 100 | volumesize /= 1024; 101 | Serial.println(volumesize); 102 | 103 | 104 | Serial.println("\nFiles found on the card (name, date and size in bytes): "); 105 | root.openRoot(volume); 106 | 107 | // list all files in the card with date and size 108 | root.ls(LS_R | LS_DATE | LS_SIZE); 109 | } 110 | 111 | 112 | void loop(void) { 113 | 114 | } 115 | -------------------------------------------------------------------------------- /libraries/SPFD5408 libraries/SPFD5408/SPFD5408_Adafruit_GFX.h: -------------------------------------------------------------------------------- 1 | #ifndef _ADAFRUIT_GFX_H 2 | #define _ADAFRUIT_GFX_H 3 | 4 | #if ARDUINO >= 100 5 | #include "Arduino.h" 6 | #include "Print.h" 7 | #else 8 | #include "WProgram.h" 9 | #endif 10 | 11 | #define swap(a, b) { int16_t t = a; a = b; b = t; } 12 | 13 | class Adafruit_GFX : public Print { 14 | 15 | public: 16 | 17 | Adafruit_GFX(int16_t w, int16_t h); // Constructor 18 | 19 | // This MUST be defined by the subclass: 20 | virtual void drawPixel(int16_t x, int16_t y, uint16_t color) = 0; 21 | 22 | // These MAY be overridden by the subclass to provide device-specific 23 | // optimized code. Otherwise 'generic' versions are used. 24 | virtual void 25 | drawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color), 26 | drawFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color), 27 | drawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color), 28 | drawRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color), 29 | fillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color), 30 | fillScreen(uint16_t color), 31 | invertDisplay(boolean i); 32 | 33 | // These exist only with Adafruit_GFX (no subclass overrides) 34 | void 35 | drawCircle(int16_t x0, int16_t y0, int16_t r, uint16_t color), 36 | drawCircleHelper(int16_t x0, int16_t y0, int16_t r, uint8_t cornername, 37 | uint16_t color), 38 | fillCircle(int16_t x0, int16_t y0, int16_t r, uint16_t color), 39 | fillCircleHelper(int16_t x0, int16_t y0, int16_t r, uint8_t cornername, 40 | int16_t delta, uint16_t color), 41 | drawTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, 42 | int16_t x2, int16_t y2, uint16_t color), 43 | fillTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, 44 | int16_t x2, int16_t y2, uint16_t color), 45 | drawRoundRect(int16_t x0, int16_t y0, int16_t w, int16_t h, 46 | int16_t radius, uint16_t color), 47 | fillRoundRect(int16_t x0, int16_t y0, int16_t w, int16_t h, 48 | int16_t radius, uint16_t color), 49 | drawBitmap(int16_t x, int16_t y, const uint8_t *bitmap, 50 | int16_t w, int16_t h, uint16_t color), 51 | drawBitmap(int16_t x, int16_t y, const uint8_t *bitmap, 52 | int16_t w, int16_t h, uint16_t color, uint16_t bg), 53 | drawXBitmap(int16_t x, int16_t y, const uint8_t *bitmap, 54 | int16_t w, int16_t h, uint16_t color), 55 | drawChar(int16_t x, int16_t y, unsigned char c, uint16_t color, 56 | uint16_t bg, uint8_t size), 57 | setCursor(int16_t x, int16_t y), 58 | setTextColor(uint16_t c), 59 | setTextColor(uint16_t c, uint16_t bg), 60 | setTextSize(uint8_t s), 61 | setTextWrap(boolean w), 62 | setRotation(uint8_t r), 63 | cp437(boolean x=true); 64 | 65 | #if ARDUINO >= 100 66 | virtual size_t write(uint8_t); 67 | #else 68 | virtual void write(uint8_t); 69 | #endif 70 | 71 | int16_t height(void) const; 72 | int16_t width(void) const; 73 | 74 | uint8_t getRotation(void) const; 75 | 76 | // get current cursor position (get rotation safe maximum values, using: width() for x, height() for y) 77 | int16_t getCursorX(void) const; 78 | int16_t getCursorY(void) const; 79 | 80 | protected: 81 | const int16_t 82 | WIDTH, HEIGHT; // This is the 'raw' display w/h - never changes 83 | int16_t 84 | _width, _height, // Display w/h as modified by current rotation 85 | cursor_x, cursor_y; 86 | uint16_t 87 | textcolor, textbgcolor; 88 | uint8_t 89 | textsize, 90 | rotation; 91 | boolean 92 | wrap, // If set, 'wrap' text at right edge of display 93 | _cp437; // If set, use correct CP437 charset (default is off) 94 | }; 95 | 96 | class Adafruit_GFX_Button { 97 | 98 | public: 99 | Adafruit_GFX_Button(void); 100 | void initButton(Adafruit_GFX *gfx, int16_t x, int16_t y, 101 | uint8_t w, uint8_t h, 102 | uint16_t outline, uint16_t fill, uint16_t textcolor, 103 | char *label, uint8_t textsize); 104 | void drawButton(boolean inverted = false); 105 | boolean contains(int16_t x, int16_t y); 106 | 107 | void press(boolean p); 108 | boolean isPressed(); 109 | boolean justPressed(); 110 | boolean justReleased(); 111 | 112 | private: 113 | Adafruit_GFX *_gfx; 114 | int16_t _x, _y; 115 | uint16_t _w, _h; 116 | uint8_t _textsize; 117 | uint16_t _outlinecolor, _fillcolor, _textcolor; 118 | char _label[10]; 119 | 120 | boolean currstate, laststate; 121 | }; 122 | 123 | #endif // _ADAFRUIT_GFX_H 124 | -------------------------------------------------------------------------------- /IC_Tester/Test_Functions.ino: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 2 | //-------------------------------------------IC Identification function-------------------------------------------------// 3 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 4 | boolean identificationCase(const String& test, int pins)//newCase Pins 5 | { 6 | boolean result = true; 7 | int clkPin = -1; 8 | for (uint8_t i = 0; i < pins; i++) 9 | { 10 | switch (test[i]) 11 | { 12 | case 'V' : pinMode(pin[i], OUTPUT); digitalWrite(pin[i], HIGH); 13 | break; 14 | case 'G' : pinMode(pin[i], OUTPUT); digitalWrite(pin[i], LOW); 15 | break; 16 | //Setting Input Signals 17 | case 'X' : 18 | case '0' : pinMode(pin[i], OUTPUT); digitalWrite(pin[i], LOW); 19 | break; 20 | case '1' : pinMode(pin[i], OUTPUT); digitalWrite(pin[i], HIGH); 21 | break; 22 | case 'C' : clkPin = pin[i]; pinMode(pin[i], OUTPUT); digitalWrite(pin[i], LOW); 23 | break; 24 | } 25 | } 26 | if (clkPin != -1) 27 | { 28 | //Clock Trigger 29 | pinMode(clkPin, INPUT_PULLUP); 30 | delay(10); 31 | pinMode(clkPin, OUTPUT); 32 | digitalWrite(clkPin, LOW); 33 | } 34 | //Reading Outputs 35 | for (uint8_t i = 0; i < pins; i++) 36 | { 37 | switch (test[i]) 38 | { 39 | case 'H' : 40 | digitalWrite(pin[i], LOW); pinMode(pin[i], INPUT_PULLUP); 41 | if (!digitalRead(pin[i])) 42 | { 43 | result = false; 44 | storeErrorLines[i] = "L"; 45 | storeErrorPlace[i] = 1; 46 | } 47 | break; 48 | case 'L' : 49 | digitalWrite(pin[i], LOW); pinMode(pin[i], INPUT_PULLUP); 50 | if (digitalRead(pin[i])) 51 | { 52 | result = false; 53 | storeErrorLines[i] = "H"; 54 | storeErrorPlace[i] = 1; 55 | } 56 | break; 57 | } 58 | } 59 | return result; 60 | } 61 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 62 | //-----------------------------------------------IC test function-------------------------------------------------------// 63 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 64 | boolean loopTestCase(const String& test, int pins)//newCase Pins 65 | { 66 | boolean result = true; 67 | int clkPin = -1; 68 | for (uint8_t i = 0; i < pins; i++) 69 | { 70 | switch (test[i]) 71 | { 72 | case 'V' : if(previousTestPinFunction[i] != 'V'){pinMode(pin[i], OUTPUT); digitalWrite(pin[i], HIGH); previousTestPinFunction[i] = 'V';} 73 | break; 74 | case 'G' : if(previousTestPinFunction[i] != 'G'){pinMode(pin[i], OUTPUT); digitalWrite(pin[i], LOW); previousTestPinFunction[i] = 'G';} 75 | break; 76 | //Setting Input Signals 77 | case 'X' : 78 | case '0' : if(previousTestPinFunction[i] != '0'){pinMode(pin[i], OUTPUT); digitalWrite(pin[i], LOW); previousTestPinFunction[i] = '0';} 79 | break; 80 | case '1' : if(previousTestPinFunction[i] != '1'){pinMode(pin[i], OUTPUT); digitalWrite(pin[i], HIGH); previousTestPinFunction[i] = '1';} 81 | break; 82 | case 'C' : clkPin = pin[i]; pinMode(pin[i], OUTPUT); digitalWrite(pin[i], LOW); 83 | break; 84 | } 85 | } 86 | if (clkPin != -1) 87 | { 88 | //Clock Trigger 89 | pinMode(clkPin, INPUT_PULLUP); 90 | delay(10); 91 | pinMode(clkPin, OUTPUT); 92 | digitalWrite(clkPin, LOW); 93 | } 94 | //Reading Outputs 95 | for (uint8_t i = 0; i < pins; i++) 96 | { 97 | switch (test[i]) 98 | { 99 | case 'H' : 100 | if(previousTestPinFunction[i] != 'H'){digitalWrite(pin[i], LOW); pinMode(pin[i], INPUT_PULLUP); previousTestPinFunction[i] = 'H';} 101 | if (!digitalRead(pin[i])) 102 | { 103 | result = false; 104 | storeErrorLines[i] = "L"; 105 | storeErrorPlace[i] = 1; 106 | } 107 | break; 108 | case 'L' : 109 | if(previousTestPinFunction[i] != 'L'){digitalWrite(pin[i], LOW); pinMode(pin[i], INPUT_PULLUP); previousTestPinFunction[i] = 'L';} 110 | if (digitalRead(pin[i])) 111 | { 112 | result = false; 113 | storeErrorLines[i] = "H"; 114 | storeErrorPlace[i] = 1; 115 | } 116 | break; 117 | } 118 | } 119 | return result; 120 | } -------------------------------------------------------------------------------- /libraries/SPFD5408 libraries/SPFD5408/SPFD5408_Adafruit_TFTLCD.h: -------------------------------------------------------------------------------- 1 | // IMPORTANT: SEE COMMENTS @ LINE 15 REGARDING SHIELD VS BREAKOUT BOARD USAGE. 2 | 3 | // Graphics library by ladyada/adafruit with init code from Rossum 4 | // MIT license 5 | 6 | // Modified for SPFD5408 by Joao Lopes 7 | 8 | #ifndef _ADAFRUIT_TFTLCD_H_ 9 | #define _ADAFRUIT_TFTLCD_H_ 10 | 11 | #if ARDUINO >= 100 12 | #include "Arduino.h" 13 | #else 14 | #include "WProgram.h" 15 | #endif 16 | 17 | // *** SPFD5408 change -- Begin 18 | #include 19 | 20 | // Color definitions 21 | #define TFTLCD_BLACK 0x0000 22 | #define TFTLCD_WHITE 0xFFFF 23 | #define TFTLCD_BLUE 0x001F 24 | #define TFTLCD_RED 0xF800 25 | #define TFTLCD_GREEN 0x07E0 26 | #define TFTLCD_CYAN 0x07FF 27 | #define TFTLCD_MAGENTA 0xF81F 28 | #define TFTLCD_YELLOW 0xFFE0 29 | #define TFTLCD_ORANGE 0xFC80 30 | #define TFTLCD_PURPLE 0x781F 31 | #define TFTLCD_SIENNA 0xF811 32 | #define TFTLCD_NEONYELLOW 0x9FE0 33 | #define TFTLCD_EMERALD 0x05E5 34 | #define TFTLCD_BLUE3 0x03FF 35 | #define TFTLCD_ROYALBLUE 0x3333 36 | #define TFTLCD_BROWN2 0x8888 37 | #define TFTLCD_PINK 0xFADF 38 | #define TFTLCD_DKPINK 0xFCDF 39 | #define TFTLCD_BROWN1 0x7083 40 | #define TFTLCD_OLIVE 0x6BC3 41 | 42 | // -- End 43 | 44 | // **** IF USING THE LCD BREAKOUT BOARD, COMMENT OUT THIS NEXT LINE. **** 45 | // **** IF USING THE LCD SHIELD, LEAVE THE LINE ENABLED: **** 46 | 47 | // *** SPFD5408 change -- Begin 48 | //#define USE_ADAFRUIT_SHIELD_PINOUT 1 49 | // -- End 50 | 51 | class Adafruit_TFTLCD : public Adafruit_GFX { 52 | 53 | public: 54 | 55 | Adafruit_TFTLCD(uint8_t cs, uint8_t cd, uint8_t wr, uint8_t rd, uint8_t rst); 56 | Adafruit_TFTLCD(void); 57 | 58 | void begin(uint16_t id = 0x9325); 59 | void drawPixel(int16_t x, int16_t y, uint16_t color); 60 | void drawFastHLine(int16_t x0, int16_t y0, int16_t w, uint16_t color); 61 | void drawFastVLine(int16_t x0, int16_t y0, int16_t h, uint16_t color); 62 | void fillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t c); 63 | void fillScreen(uint16_t color); 64 | void reset(void); 65 | void setRegisters8(uint8_t *ptr, uint8_t n); 66 | void setRegisters16(uint16_t *ptr, uint8_t n); 67 | void setRotation(uint8_t x); 68 | // These methods are public in order for BMP examples to work: 69 | void setAddrWindow(int x1, int y1, int x2, int y2); 70 | void pushColors(uint16_t *data, uint8_t len, boolean first); 71 | 72 | uint16_t color565(uint8_t r, uint8_t g, uint8_t b), 73 | readPixel(int16_t x, int16_t y), 74 | readID(void); 75 | uint32_t readReg(uint8_t r); 76 | 77 | private: 78 | 79 | void init(), 80 | // These items may have previously been defined as macros 81 | // in pin_magic.h. If not, function versions are declared: 82 | #ifndef write8 83 | write8(uint8_t value), 84 | #endif 85 | #ifndef setWriteDir 86 | setWriteDir(void), 87 | #endif 88 | #ifndef setReadDir 89 | setReadDir(void), 90 | #endif 91 | #ifndef writeRegister8 92 | writeRegister8(uint8_t a, uint8_t d), 93 | #endif 94 | #ifndef writeRegister16 95 | writeRegister16(uint16_t a, uint16_t d), 96 | #endif 97 | writeRegister24(uint8_t a, uint32_t d), 98 | writeRegister32(uint8_t a, uint32_t d), 99 | #ifndef writeRegisterPair 100 | writeRegisterPair(uint8_t aH, uint8_t aL, uint16_t d), 101 | #endif 102 | setLR(void), 103 | flood(uint16_t color, uint32_t len); 104 | uint8_t driver; 105 | 106 | #ifndef read8 107 | uint8_t read8fn(void); 108 | #define read8isFunctionalized 109 | #endif 110 | 111 | #ifndef USE_ADAFRUIT_SHIELD_PINOUT 112 | 113 | #ifdef __AVR__ 114 | volatile uint8_t *csPort , *cdPort , *wrPort , *rdPort; 115 | uint8_t csPinSet , cdPinSet , wrPinSet , rdPinSet , 116 | csPinUnset, cdPinUnset, wrPinUnset, rdPinUnset, 117 | _reset; 118 | #endif 119 | #if defined(__SAM3X8E__) 120 | Pio *csPort , *cdPort , *wrPort , *rdPort; 121 | uint32_t csPinSet , cdPinSet , wrPinSet , rdPinSet , 122 | csPinUnset, cdPinUnset, wrPinUnset, rdPinUnset, 123 | _reset; 124 | #endif 125 | 126 | #endif 127 | }; 128 | 129 | // For compatibility with sketches written for older versions of library. 130 | // Color function name was changed to 'color565' for parity with 2.2" LCD 131 | // library. 132 | #define Color565 color565 133 | 134 | #endif 135 | -------------------------------------------------------------------------------- /libraries/Adafruit libraries/Adafruit_GFX_Library/Adafruit_SPITFT_Macros.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Control Pins 4 | * */ 5 | 6 | #ifdef USE_FAST_PINIO 7 | #define SPI_DC_HIGH() *dcport |= dcpinmask 8 | #define SPI_DC_LOW() *dcport &= ~dcpinmask 9 | #define SPI_CS_HIGH() *csport |= cspinmask 10 | #define SPI_CS_LOW() *csport &= ~cspinmask 11 | #else 12 | #define SPI_DC_HIGH() digitalWrite(_dc, HIGH) 13 | #define SPI_DC_LOW() digitalWrite(_dc, LOW) 14 | #define SPI_CS_HIGH() digitalWrite(_cs, HIGH) 15 | #define SPI_CS_LOW() digitalWrite(_cs, LOW) 16 | #endif 17 | 18 | /* 19 | * Software SPI Macros 20 | * */ 21 | 22 | #ifdef USE_FAST_PINIO 23 | #define SSPI_MOSI_HIGH() *mosiport |= mosipinmask 24 | #define SSPI_MOSI_LOW() *mosiport &= ~mosipinmask 25 | #define SSPI_SCK_HIGH() *clkport |= clkpinmask 26 | #define SSPI_SCK_LOW() *clkport &= ~clkpinmask 27 | #define SSPI_MISO_READ() ((*misoport & misopinmask) != 0) 28 | #else 29 | #define SSPI_MOSI_HIGH() digitalWrite(_mosi, HIGH) 30 | #define SSPI_MOSI_LOW() digitalWrite(_mosi, LOW) 31 | #define SSPI_SCK_HIGH() digitalWrite(_sclk, HIGH) 32 | #define SSPI_SCK_LOW() digitalWrite(_sclk, LOW) 33 | #define SSPI_MISO_READ() digitalRead(_miso) 34 | #endif 35 | 36 | #define SSPI_BEGIN_TRANSACTION() 37 | #define SSPI_END_TRANSACTION() 38 | #define SSPI_WRITE(v) spiWrite(v) 39 | #define SSPI_WRITE16(s) SSPI_WRITE((s) >> 8); SSPI_WRITE(s) 40 | #define SSPI_WRITE32(l) SSPI_WRITE((l) >> 24); SSPI_WRITE((l) >> 16); SSPI_WRITE((l) >> 8); SSPI_WRITE(l) 41 | #define SSPI_WRITE_PIXELS(c,l) for(uint32_t i=0; i<(l); i+=2){ SSPI_WRITE(((uint8_t*)(c))[i+1]); SSPI_WRITE(((uint8_t*)(c))[i]); } 42 | 43 | /* 44 | * Hardware SPI Macros 45 | * */ 46 | 47 | #define SPI_OBJECT SPI 48 | 49 | #if defined (__AVR__) || defined(TEENSYDUINO) || defined(ARDUINO_ARCH_STM32F1) 50 | #define HSPI_SET_CLOCK() SPI_OBJECT.setClockDivider(SPI_CLOCK_DIV2); 51 | #elif defined (__arm__) 52 | #define HSPI_SET_CLOCK() SPI_OBJECT.setClockDivider(11); 53 | #elif defined(ESP8266) || defined(ESP32) 54 | #define HSPI_SET_CLOCK() SPI_OBJECT.setFrequency(_freq); 55 | #elif defined(RASPI) 56 | #define HSPI_SET_CLOCK() SPI_OBJECT.setClock(_freq); 57 | #elif defined(ARDUINO_ARCH_STM32F1) 58 | #define HSPI_SET_CLOCK() SPI_OBJECT.setClock(_freq); 59 | #else 60 | #define HSPI_SET_CLOCK() 61 | #endif 62 | 63 | #ifdef SPI_HAS_TRANSACTION 64 | #define HSPI_BEGIN_TRANSACTION() SPI_OBJECT.beginTransaction(SPISettings(_freq, MSBFIRST, SPI_MODE0)) 65 | #define HSPI_END_TRANSACTION() SPI_OBJECT.endTransaction() 66 | #else 67 | #define HSPI_BEGIN_TRANSACTION() HSPI_SET_CLOCK(); SPI_OBJECT.setBitOrder(MSBFIRST); SPI_OBJECT.setDataMode(SPI_MODE0) 68 | #define HSPI_END_TRANSACTION() 69 | #endif 70 | 71 | #ifdef ESP32 72 | #define SPI_HAS_WRITE_PIXELS 73 | #endif 74 | #if defined(ESP8266) || defined(ESP32) 75 | // Optimized SPI (ESP8266 and ESP32) 76 | #define HSPI_READ() SPI_OBJECT.transfer(0) 77 | #define HSPI_WRITE(b) SPI_OBJECT.write(b) 78 | #define HSPI_WRITE16(s) SPI_OBJECT.write16(s) 79 | #define HSPI_WRITE32(l) SPI_OBJECT.write32(l) 80 | #ifdef SPI_HAS_WRITE_PIXELS 81 | #define SPI_MAX_PIXELS_AT_ONCE 32 82 | #define HSPI_WRITE_PIXELS(c,l) SPI_OBJECT.writePixels(c,l) 83 | #else 84 | #define HSPI_WRITE_PIXELS(c,l) for(uint32_t i=0; i<((l)/2); i++){ SPI_WRITE16(((uint16_t*)(c))[i]); } 85 | #endif 86 | #else 87 | // Standard Byte-by-Byte SPI 88 | 89 | #if defined (__AVR__) || defined(TEENSYDUINO) 90 | static inline uint8_t _avr_spi_read(void) __attribute__((always_inline)); 91 | static inline uint8_t _avr_spi_read(void) { 92 | uint8_t r = 0; 93 | SPDR = r; 94 | while(!(SPSR & _BV(SPIF))); 95 | r = SPDR; 96 | return r; 97 | } 98 | #define HSPI_WRITE(b) {SPDR = (b); while(!(SPSR & _BV(SPIF)));} 99 | #define HSPI_READ() _avr_spi_read() 100 | #else 101 | #define HSPI_WRITE(b) SPI_OBJECT.transfer((uint8_t)(b)) 102 | #define HSPI_READ() HSPI_WRITE(0) 103 | #endif 104 | #define HSPI_WRITE16(s) HSPI_WRITE((s) >> 8); HSPI_WRITE(s) 105 | #define HSPI_WRITE32(l) HSPI_WRITE((l) >> 24); HSPI_WRITE((l) >> 16); HSPI_WRITE((l) >> 8); HSPI_WRITE(l) 106 | #define HSPI_WRITE_PIXELS(c,l) for(uint32_t i=0; i<(l); i+=2){ HSPI_WRITE(((uint8_t*)(c))[i+1]); HSPI_WRITE(((uint8_t*)(c))[i]); } 107 | #endif 108 | 109 | #define SPI_BEGIN() if(_sclk < 0){SPI_OBJECT.begin();} 110 | #define SPI_BEGIN_TRANSACTION() if(_sclk < 0){HSPI_BEGIN_TRANSACTION();} 111 | #define SPI_END_TRANSACTION() if(_sclk < 0){HSPI_END_TRANSACTION();} 112 | #define SPI_WRITE16(s) if(_sclk < 0){HSPI_WRITE16(s);}else{SSPI_WRITE16(s);} 113 | #define SPI_WRITE32(l) if(_sclk < 0){HSPI_WRITE32(l);}else{SSPI_WRITE32(l);} 114 | #define SPI_WRITE_PIXELS(c,l) if(_sclk < 0){HSPI_WRITE_PIXELS(c,l);}else{SSPI_WRITE_PIXELS(c,l);} 115 | -------------------------------------------------------------------------------- /libraries/SPFD5408 libraries/SPFD5408/fontconvert/bdf2adafruit.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python2 2 | 3 | # MIT License. 4 | 5 | # Copyright (c) 2016 William Skellenger 6 | # 7 | # Permission is hereby granted, free of charge, to any person obtaining a 8 | # copy of this software and associated documentation files (the "Software"), 9 | # to deal in the Software without restriction, including without limitation 10 | # the rights to use, copy, modify, merge, publish, distribute, sublicense, 11 | # and/or sell copies of the Software, and to permit persons to whom the 12 | # Software is furnished to do so, subject to the following conditions: 13 | # 14 | # The above copyright notice and this permission notice shall be included 15 | # in all copies or substantial portions of the Software. 16 | # 17 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 18 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 23 | # IN THE SOFTWARE. 24 | 25 | # This small script is designed to mostly take a BDF file and convert it to a 26 | # format that can largely be cut/pasted as an Adafruit-format font. 27 | # It was written in an hour or so and did what I needed it to do. 28 | # I used it for one file. Maybe it bombs on other files. 29 | # William Skellenger, Feb 2016 30 | # (email: williamj@skellenger.net) 31 | # (Twitter: @skelliam) 32 | # 33 | # Usage: bdf2adafruit.py > out.txt 34 | # 35 | # Once you have out.txt you can cut/paste the contents into a new font 36 | # header file as part of the Adafruit GFX library. 37 | 38 | import sys 39 | 40 | myfile = open(sys.argv[1]) 41 | 42 | processing = 0 43 | getting_rows = 0 44 | 45 | chars = [] 46 | bitmapData = [] 47 | 48 | class Glyph: 49 | encoding = -1 50 | rows = [] 51 | comment = "" 52 | offset = -1 53 | width = 0 54 | height = 0 55 | advance = 0 56 | xoffs = 0 57 | yoffs = 0 58 | def __init__(self, comment): 59 | self.comment = comment 60 | self.rows = [] 61 | 62 | for line in myfile.readlines(): 63 | if 'STARTCHAR' in line: 64 | processing = 1 65 | vals = line.split() 66 | g = Glyph(vals[1]) 67 | #g.width = 8 #in this example always 8 bits wide 68 | elif 'ENDCHAR' in line: 69 | dataByteCompressed = 0 70 | dataByteCompressedIndex = 8 71 | g.height = len(bitmapData) 72 | for value in bitmapData: 73 | bitIndex = 0 74 | while bitIndex < g.width: 75 | bit = (value >> (7 - bitIndex)) & 0x01 76 | dataByteCompressed |= bit << (dataByteCompressedIndex - 1) 77 | dataByteCompressedIndex -= 1 78 | if dataByteCompressedIndex == 0: 79 | dataByteCompressedIndex = 8 80 | g.rows.append(dataByteCompressed) 81 | dataByteCompressed = 0 82 | bitIndex += 1 83 | if 8 != dataByteCompressedIndex: 84 | g.rows.append(dataByteCompressed) 85 | 86 | chars.append(g) #append the completed glyph into list 87 | processing = 0 88 | getting_rows = 0 89 | bitmapData.clear() 90 | 91 | if processing: 92 | if 'ENCODING' in line: 93 | vals = line.split() 94 | g.encoding = int(vals[1]) 95 | elif 'DWIDTH' in line: 96 | vals = line.split() 97 | #g.advance = int(vals[1]) #cursor advance seems to be the first number in DWIDTH 98 | elif 'BBX' in line: 99 | vals = line.split() 100 | g.xoffs = 0 101 | g.yoffs = -(int(vals[2]) + int(vals[4])) 102 | g.advance = (int(vals[1]) + 1) #x bounding box + 1 103 | g.width = int(vals[1]) 104 | elif 'BITMAP' in line: 105 | getting_rows = 1 106 | elif getting_rows: 107 | #g.rows.append(int(line, 16)) #append pixel rows into glyph's list of rows 108 | bitmapData.append(int(line, 16)) 109 | 110 | print 111 | 112 | i=0 113 | for char in chars: 114 | char.offset = i 115 | print("\t", end='') 116 | num = 3 117 | for row in char.rows: 118 | if num != 3: 119 | print(" ", end = '') 120 | print("0x%02X," %(row), end = ''), 121 | i+=1 122 | num-=1 123 | 124 | if num == 1: 125 | print("\t\t", end = '') 126 | if num == 2: 127 | print("\t\t\t", end = '') 128 | print("\t/* 0x%02X %s */" %(char.encoding, char.comment)) 129 | 130 | for char in chars: 131 | # offset, bit-width, bit-height, advance cursor, x offset, y offset 132 | print("\t{ %d, %d, %d, %d, %d, %d }, /* 0x%02X %s */" %( 133 | char.offset, char.width, char.height, 134 | char.advance, char.xoffs, char.yoffs, 135 | char.encoding, char.comment)) 136 | -------------------------------------------------------------------------------- /IC_Tester/IC_search.ino: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------------------------------------------------// 2 | //-----------------------------------------IC identification function---------------------------------------------------// 3 | //----------------------------------------------------------------------------------------------------------------------// 4 | void autoSearch(int pins) 5 | { 6 | File dataFile = SD.open(fname); //open the test database 7 | int t = 120; //position of ICs that matched 8 | String nameAuto[10];//stores the matched ICs here 9 | numberofIcs = 0;//Used here to indicate if the chip chosen by user is in the database 10 | String newCase; //Line in the test sequence 11 | chip newChip; //Ic's being tested 12 | uint8_t ICpins;//In the autotest sequence the only thing the program has to go on is how many pins the chip has so it uses all the tests for appropriate number of pins on a chip under test. 13 | boolean result; //if the number of pin matches 14 | chip ans[10];//here the program stores all the chips that passed the test. 15 | pinNumberRouting = pins; 16 | //----------------------------------------------------Header graphics---------------------------------------------------// 17 | tft.fillScreen(BLACK); //"clears" the screen 18 | tft.setCursor(10, 10); 19 | tft.setTextColor(BLUE); tft.setTextSize(4); 20 | tft.println(F("IC TESTER")); 21 | tft.setCursor(12, 12); 22 | tft.setTextColor(GREY); tft.setTextSize(4); 23 | tft.println(F("IC TESTER")); 24 | tft.setCursor(22, 46); 25 | tft.setTextColor(GREY); tft.setTextSize(3); 26 | tft.println(F("Identifying")); 27 | tft.setCursor(20, 45); 28 | tft.setTextColor(WHITE); tft.setTextSize(3); 29 | tft.println(F("Identifying")); 30 | tft.setTextColor(GREY);tft.setTextSize(2); 31 | tft.setCursor(10, 100); // 32 | tft.print(F("Number of pins: ")); tft.println(pins); 33 | 34 | if (dataFile) //here the reading/comparing of SD data begins 35 | { 36 | uint8_t count = 0; //holds the number of matches 37 | pin = pins; 38 | 39 | switch(pins) 40 | { 41 | case 14:pin = PIN14; 42 | break; 43 | case 16:pin = PIN16; 44 | break; 45 | case 20:pin = PIN20; 46 | break; 47 | case 24:pin = PIN24; 48 | break; 49 | } 50 | 51 | while (dataFile.available()) 52 | { 53 | dataFile.readStringUntil('$'); 54 | newChip.num .reserve(6); 55 | newChip.num = dataFile.readStringUntil('\n'); //here it stores the number of each IC it reads 56 | newChip.name = dataFile.readStringUntil('\n'); //this is where the description of the IC is stored 57 | ICpins = dataFile.readStringUntil('\n').toInt(); //here it stores the number of pins each IC it reads in the datafile so it can be matched with the user assigned number of pins 58 | 59 | if(switches.fastMode == 0) {tft.setTextColor(BLUE);tft.setTextSize(3); tft.setCursor(80, 75); tft.println(newChip.num);} //What Ic's are beeing tested, clearing them is further down in code 60 | if (ICpins == pins) //comparing the number of pins on IC read and the user chosen one 61 | { 62 | result = true; //the number of pins matches 63 | while (dataFile.peek() != '$') //the testing of an IC starts 64 | { 65 | newCase.reserve(25); 66 | newCase = dataFile.readStringUntil('\n'); ;//Applies test sequences found in the database.txt file 67 | newCase.trim(); 68 | 69 | if (identificationCase(newCase, ICpins) == false)//If the chip failed the test it continues 70 | { 71 | result = false; 72 | break; 73 | } 74 | } 75 | if (result == true)//The chips that passed the tests 76 | { 77 | newChip.num.reserve(6); 78 | chipDescription = newChip.name;//storing description of IC that passed a test 79 | ans[count++] = newChip; //here we store the informations of matched ICs 80 | tft.setTextColor(WHITE);tft.setTextSize(2);//What IC matched 81 | 82 | if(!isDigit(newChip.num[4]))//this is a position for those chips with 4 numbers in their ID 83 | { 84 | tft.setCursor(100, t); //position for the chips that have passed a test 85 | } 86 | if(isDigit(newChip.num[4]))//this is a position for those chips with 5 numbers in their ID 87 | { 88 | tft.setCursor(93, t); 89 | } 90 | tft.println(newChip.num); 91 | t=t+20; 92 | } 93 | } 94 | if(switches.fastMode == 0){ tft.setTextColor(BLACK);tft.setTextSize(3); tft.setCursor(80, 75); tft.println(newChip.num);}//clearing Ic's that have been tested 95 | } 96 | dataFile.close();//here the reading/comparing test phase of SD data ends 97 | 98 | if (count != 0) 99 | { 100 | numberofIcs = count;//to store number of ICs matched in every scope 101 | for(uint8_t r=0; r' 61 | {46, 2, 3, 4, 1, -2}, // 0x3F '?' 62 | {47, 3, 3, 4, 0, -2}, // 0x40 '@' 63 | {49, 3, 3, 4, 0, -2}, // 0x41 'A' 64 | {51, 3, 3, 4, 0, -2}, // 0x42 'B' 65 | {53, 3, 3, 4, 0, -2}, // 0x43 'C' 66 | {55, 3, 3, 4, 0, -2}, // 0x44 'D' 67 | {57, 3, 3, 4, 0, -2}, // 0x45 'E' 68 | {59, 3, 3, 4, 0, -2}, // 0x46 'F' 69 | {61, 3, 3, 4, 0, -2}, // 0x47 'G' 70 | {63, 3, 3, 4, 0, -2}, // 0x48 'H' 71 | {65, 1, 3, 3, 1, -2}, // 0x49 'I' 72 | {66, 3, 3, 4, 0, -2}, // 0x4A 'J' 73 | {68, 3, 3, 4, 0, -2}, // 0x4B 'K' 74 | {70, 3, 3, 4, 0, -2}, // 0x4C 'L' 75 | {72, 3, 3, 4, 0, -2}, // 0x4D 'M' 76 | {74, 3, 3, 4, 0, -2}, // 0x4E 'N' 77 | {76, 3, 3, 4, 0, -2}, // 0x4F 'O' 78 | {78, 3, 3, 4, 0, -2}, // 0x50 'P' 79 | {80, 3, 3, 4, 0, -2}, // 0x51 'Q' 80 | {82, 3, 3, 4, 0, -2}, // 0x52 'R' 81 | {84, 3, 3, 4, 0, -2}, // 0x53 'S' 82 | {86, 3, 3, 4, 0, -2}, // 0x54 'T' 83 | {88, 3, 3, 4, 0, -2}, // 0x55 'U' 84 | {90, 3, 3, 4, 0, -2}, // 0x56 'V' 85 | {92, 3, 3, 4, 0, -2}, // 0x57 'W' 86 | {94, 3, 3, 4, 0, -2}, // 0x58 'X' 87 | {96, 3, 3, 4, 0, -2}, // 0x59 'Y' 88 | {98, 3, 3, 4, 0, -2}, // 0x5A 'Z' 89 | {100, 2, 3, 3, 0, -2}, // 0x5B '[' 90 | {101, 3, 3, 4, 0, -2}, // 0x5C '\' 91 | {103, 2, 3, 4, 1, -2}, // 0x5D ']' 92 | {104, 3, 2, 4, 0, -2}, // 0x5E '^' 93 | {105, 3, 1, 4, 0, 0}, // 0x5F '_' 94 | {106, 2, 2, 3, 0, -2}, // 0x60 '`' 95 | {107, 2, 2, 3, 0, -1}, // 0x61 'a' 96 | {108, 2, 3, 3, 0, -2}, // 0x62 'b' 97 | {109, 2, 2, 3, 0, -1}, // 0x63 'c' 98 | {110, 2, 3, 3, 0, -2}, // 0x64 'd' 99 | {111, 2, 2, 3, 0, -1}, // 0x65 'e' 100 | {112, 2, 3, 3, 0, -2}, // 0x66 'f' 101 | {113, 2, 3, 3, 0, -1}, // 0x67 'g' 102 | {114, 2, 3, 3, 0, -2}, // 0x68 'h' 103 | {115, 1, 2, 2, 0, -1}, // 0x69 'i' 104 | {116, 2, 3, 3, 0, -1}, // 0x6A 'j' 105 | {117, 3, 3, 4, 0, -2}, // 0x6B 'k' 106 | {119, 2, 3, 3, 0, -2}, // 0x6C 'l' 107 | {120, 3, 2, 4, 0, -1}, // 0x6D 'm' 108 | {121, 3, 2, 4, 0, -1}, // 0x6E 'n' 109 | {122, 2, 2, 3, 0, -1}, // 0x6F 'o' 110 | {123, 2, 3, 3, 0, -1}, // 0x70 'p' 111 | {124, 2, 3, 3, 0, -1}, // 0x71 'q' 112 | {125, 2, 2, 3, 0, -1}, // 0x72 'r' 113 | {126, 2, 2, 3, 0, -1}, // 0x73 's' 114 | {127, 3, 3, 4, 0, -2}, // 0x74 't' 115 | {129, 3, 2, 4, 0, -1}, // 0x75 'u' 116 | {130, 3, 2, 4, 0, -1}, // 0x76 'v' 117 | {131, 3, 2, 4, 0, -1}, // 0x77 'w' 118 | {132, 2, 2, 3, 0, -1}, // 0x78 'x' 119 | {133, 3, 3, 4, 0, -1}, // 0x79 'y' 120 | {135, 2, 2, 3, 0, -1}, // 0x7A 'z' 121 | {136, 3, 3, 4, 0, -2}, // 0x7B '{' 122 | {138, 1, 4, 3, 1, -2}, // 0x7C '|' 123 | {139, 3, 3, 4, 0, -2}, // 0x7D '}' 124 | {141, 3, 2, 4, 0, -2}}; // 0x7E '~' 125 | 126 | const GFXfont Tiny3x3a2pt7b PROGMEM = {(uint8_t *)Tiny3x3a2pt7bBitmaps, 127 | (GFXglyph *)Tiny3x3a2pt7bGlyphs, 0x20, 128 | 0x7E, 4}; 129 | 130 | // Approx. 814 bytes 131 | -------------------------------------------------------------------------------- /libraries/SPFD5408 libraries/SPFD5408_TFT_Library/examples/tftpaint_shield/tftpaint_shield.ino: -------------------------------------------------------------------------------- 1 | // Paint example specifically for the TFTLCD Arduino shield. 2 | // If using the breakout board, use the tftpaint.pde sketch instead! 3 | 4 | #include // Core graphics library 5 | #include // Hardware-specific library 6 | #include 7 | 8 | #if defined(__SAM3X8E__) 9 | #undef __FlashStringHelper::F(string_literal) 10 | #define F(string_literal) string_literal 11 | #endif 12 | 13 | #ifndef USE_ADAFRUIT_SHIELD_PINOUT 14 | #error "This sketch is intended for use with the TFT LCD Shield. Make sure that USE_ADAFRUIT_SHIELD_PINOUT is #defined in the TftSpfd5408.h library file." 15 | #endif 16 | 17 | // These are the pins for the shield! 18 | #define YP A1 // must be an analog pin, use "An" notation! 19 | #define XM A2 // must be an analog pin, use "An" notation! 20 | #define YM 7 // can be a digital pin 21 | #define XP 6 // can be a digital pin 22 | 23 | #ifdef __SAM3X8E__ 24 | #define TS_MINX 125 25 | #define TS_MINY 170 26 | #define TS_MAXX 880 27 | #define TS_MAXY 940 28 | #else 29 | #define TS_MINX 150 30 | #define TS_MINY 120 31 | #define TS_MAXX 920 32 | #define TS_MAXY 940 33 | #endif 34 | 35 | // For better pressure precision, we need to know the resistance 36 | // between X+ and X- Use any multimeter to read it 37 | // For the one we're using, its 300 ohms across the X plate 38 | TouchScreen ts = TouchScreen(XP, YP, XM, YM, 300); 39 | 40 | #define LCD_CS A3 41 | #define LCD_CD A2 42 | #define LCD_WR A1 43 | #define LCD_RD A0 44 | 45 | // Assign human-readable names to some common 16-bit color values: 46 | #define BLACK 0x0000 47 | #define BLUE 0x001F 48 | #define RED 0xF800 49 | #define GREEN 0x07E0 50 | #define CYAN 0x07FF 51 | #define MAGENTA 0xF81F 52 | #define YELLOW 0xFFE0 53 | #define WHITE 0xFFFF 54 | 55 | 56 | TftSpfd5408 tft; 57 | 58 | #define BOXSIZE 40 59 | #define PENRADIUS 4 60 | int oldcolor, currentcolor; 61 | 62 | void setup(void) { 63 | Serial.begin(9600); 64 | Serial.println(F("Paint!")); 65 | 66 | tft.reset(); 67 | 68 | uint16_t identifier = tft.readID(); 69 | 70 | if(identifier == 0x9325) { 71 | Serial.println(F("Found ILI9325 LCD driver")); 72 | } else if(identifier == 0x9328) { 73 | Serial.println(F("Found ILI9328 LCD driver")); 74 | } else if(identifier == 0x7575) { 75 | Serial.println(F("Found HX8347G LCD driver")); 76 | } else { 77 | Serial.print(F("Unknown LCD driver chip: ")); 78 | Serial.println(identifier, HEX); 79 | return; 80 | } 81 | 82 | tft.begin(identifier); 83 | 84 | tft.fillScreen(BLACK); 85 | 86 | tft.fillRect(0, 0, BOXSIZE, BOXSIZE, RED); 87 | tft.fillRect(BOXSIZE, 0, BOXSIZE, BOXSIZE, YELLOW); 88 | tft.fillRect(BOXSIZE*2, 0, BOXSIZE, BOXSIZE, GREEN); 89 | tft.fillRect(BOXSIZE*3, 0, BOXSIZE, BOXSIZE, CYAN); 90 | tft.fillRect(BOXSIZE*4, 0, BOXSIZE, BOXSIZE, BLUE); 91 | tft.fillRect(BOXSIZE*5, 0, BOXSIZE, BOXSIZE, MAGENTA); 92 | // tft.fillRect(BOXSIZE*6, 0, BOXSIZE, BOXSIZE, WHITE); 93 | 94 | tft.drawRect(0, 0, BOXSIZE, BOXSIZE, WHITE); 95 | currentcolor = RED; 96 | 97 | pinMode(13, OUTPUT); 98 | } 99 | 100 | #define MINPRESSURE 10 101 | #define MAXPRESSURE 1000 102 | 103 | void loop() 104 | { 105 | digitalWrite(13, HIGH); 106 | TSPoint p = ts.getPoint(); 107 | digitalWrite(13, LOW); 108 | 109 | // if sharing pins, you'll need to fix the directions of the touchscreen pins 110 | //pinMode(XP, OUTPUT); 111 | pinMode(XM, OUTPUT); 112 | pinMode(YP, OUTPUT); 113 | //pinMode(YM, OUTPUT); 114 | 115 | // we have some minimum pressure we consider 'valid' 116 | // pressure of 0 means no pressing! 117 | 118 | if (p.z > MINPRESSURE && p.z < MAXPRESSURE) { 119 | /* 120 | Serial.print("X = "); Serial.print(p.x); 121 | Serial.print("\tY = "); Serial.print(p.y); 122 | Serial.print("\tPressure = "); Serial.println(p.z); 123 | */ 124 | 125 | if (p.y < (TS_MINY-5)) { 126 | Serial.println("erase"); 127 | // press the bottom of the screen to erase 128 | tft.fillRect(0, BOXSIZE, tft.width(), tft.height()-BOXSIZE, BLACK); 129 | } 130 | // scale from 0->1023 to tft.width 131 | p.x = map(p.x, TS_MINX, TS_MAXX, tft.width(), 0); 132 | p.y = map(p.y, TS_MINY, TS_MAXY, tft.height(), 0); 133 | /* 134 | Serial.print("("); Serial.print(p.x); 135 | Serial.print(", "); Serial.print(p.y); 136 | Serial.println(")"); 137 | */ 138 | if (p.y < BOXSIZE) { 139 | oldcolor = currentcolor; 140 | 141 | if (p.x < BOXSIZE) { 142 | currentcolor = RED; 143 | tft.drawRect(0, 0, BOXSIZE, BOXSIZE, WHITE); 144 | } else if (p.x < BOXSIZE*2) { 145 | currentcolor = YELLOW; 146 | tft.drawRect(BOXSIZE, 0, BOXSIZE, BOXSIZE, WHITE); 147 | } else if (p.x < BOXSIZE*3) { 148 | currentcolor = GREEN; 149 | tft.drawRect(BOXSIZE*2, 0, BOXSIZE, BOXSIZE, WHITE); 150 | } else if (p.x < BOXSIZE*4) { 151 | currentcolor = CYAN; 152 | tft.drawRect(BOXSIZE*3, 0, BOXSIZE, BOXSIZE, WHITE); 153 | } else if (p.x < BOXSIZE*5) { 154 | currentcolor = BLUE; 155 | tft.drawRect(BOXSIZE*4, 0, BOXSIZE, BOXSIZE, WHITE); 156 | } else if (p.x < BOXSIZE*6) { 157 | currentcolor = MAGENTA; 158 | tft.drawRect(BOXSIZE*5, 0, BOXSIZE, BOXSIZE, WHITE); 159 | } 160 | 161 | if (oldcolor != currentcolor) { 162 | if (oldcolor == RED) tft.fillRect(0, 0, BOXSIZE, BOXSIZE, RED); 163 | if (oldcolor == YELLOW) tft.fillRect(BOXSIZE, 0, BOXSIZE, BOXSIZE, YELLOW); 164 | if (oldcolor == GREEN) tft.fillRect(BOXSIZE*2, 0, BOXSIZE, BOXSIZE, GREEN); 165 | if (oldcolor == CYAN) tft.fillRect(BOXSIZE*3, 0, BOXSIZE, BOXSIZE, CYAN); 166 | if (oldcolor == BLUE) tft.fillRect(BOXSIZE*4, 0, BOXSIZE, BOXSIZE, BLUE); 167 | if (oldcolor == MAGENTA) tft.fillRect(BOXSIZE*5, 0, BOXSIZE, BOXSIZE, MAGENTA); 168 | } 169 | } 170 | if (((p.y-PENRADIUS) > BOXSIZE) && ((p.y+PENRADIUS) < tft.height())) { 171 | tft.fillCircle(p.x, p.y, PENRADIUS, currentcolor); 172 | } 173 | } 174 | } 175 | 176 | -------------------------------------------------------------------------------- /libraries/Adafruit libraries/Adafruit_TFTLCD/examples/tftpaint_shield/tftpaint_shield.ino: -------------------------------------------------------------------------------- 1 | // Paint example specifically for the TFTLCD Arduino shield. 2 | // If using the breakout board, use the tftpaint.pde sketch instead! 3 | 4 | #include // Core graphics library 5 | #include // Hardware-specific library 6 | #include 7 | 8 | #if defined(__SAM3X8E__) 9 | #undef __FlashStringHelper::F(string_literal) 10 | #define F(string_literal) string_literal 11 | #endif 12 | 13 | #ifndef USE_ADAFRUIT_SHIELD_PINOUT 14 | #error "This sketch is intended for use with the TFT LCD Shield. Make sure that USE_ADAFRUIT_SHIELD_PINOUT is #defined in the Adafruit_TFTLCD.h library file." 15 | #endif 16 | 17 | // These are the pins for the shield! 18 | #define YP A1 // must be an analog pin, use "An" notation! 19 | #define XM A2 // must be an analog pin, use "An" notation! 20 | #define YM 7 // can be a digital pin 21 | #define XP 6 // can be a digital pin 22 | 23 | #ifdef __SAM3X8E__ 24 | #define TS_MINX 125 25 | #define TS_MINY 170 26 | #define TS_MAXX 880 27 | #define TS_MAXY 940 28 | #else 29 | #define TS_MINX 150 30 | #define TS_MINY 120 31 | #define TS_MAXX 920 32 | #define TS_MAXY 940 33 | #endif 34 | 35 | // For better pressure precision, we need to know the resistance 36 | // between X+ and X- Use any multimeter to read it 37 | // For the one we're using, its 300 ohms across the X plate 38 | TouchScreen ts = TouchScreen(XP, YP, XM, YM, 300); 39 | 40 | #define LCD_CS A3 41 | #define LCD_CD A2 42 | #define LCD_WR A1 43 | #define LCD_RD A0 44 | 45 | // Assign human-readable names to some common 16-bit color values: 46 | #define BLACK 0x0000 47 | #define BLUE 0x001F 48 | #define RED 0xF800 49 | #define GREEN 0x07E0 50 | #define CYAN 0x07FF 51 | #define MAGENTA 0xF81F 52 | #define YELLOW 0xFFE0 53 | #define WHITE 0xFFFF 54 | 55 | 56 | Adafruit_TFTLCD tft; 57 | 58 | #define BOXSIZE 40 59 | #define PENRADIUS 4 60 | int oldcolor, currentcolor; 61 | 62 | void setup(void) { 63 | Serial.begin(9600); 64 | Serial.println(F("Paint!")); 65 | 66 | tft.reset(); 67 | 68 | uint16_t identifier = tft.readID(); 69 | 70 | if(identifier == 0x9325) { 71 | Serial.println(F("Found ILI9325 LCD driver")); 72 | } else if(identifier == 0x9328) { 73 | Serial.println(F("Found ILI9328 LCD driver")); 74 | } else if(identifier == 0x7575) { 75 | Serial.println(F("Found HX8347G LCD driver")); 76 | } else { 77 | Serial.print(F("Unknown LCD driver chip: ")); 78 | Serial.println(identifier, HEX); 79 | return; 80 | } 81 | 82 | tft.begin(identifier); 83 | 84 | tft.fillScreen(BLACK); 85 | 86 | tft.fillRect(0, 0, BOXSIZE, BOXSIZE, RED); 87 | tft.fillRect(BOXSIZE, 0, BOXSIZE, BOXSIZE, YELLOW); 88 | tft.fillRect(BOXSIZE*2, 0, BOXSIZE, BOXSIZE, GREEN); 89 | tft.fillRect(BOXSIZE*3, 0, BOXSIZE, BOXSIZE, CYAN); 90 | tft.fillRect(BOXSIZE*4, 0, BOXSIZE, BOXSIZE, BLUE); 91 | tft.fillRect(BOXSIZE*5, 0, BOXSIZE, BOXSIZE, MAGENTA); 92 | // tft.fillRect(BOXSIZE*6, 0, BOXSIZE, BOXSIZE, WHITE); 93 | 94 | tft.drawRect(0, 0, BOXSIZE, BOXSIZE, WHITE); 95 | currentcolor = RED; 96 | 97 | pinMode(13, OUTPUT); 98 | } 99 | 100 | #define MINPRESSURE 10 101 | #define MAXPRESSURE 1000 102 | 103 | void loop() 104 | { 105 | digitalWrite(13, HIGH); 106 | TSPoint p = ts.getPoint(); 107 | digitalWrite(13, LOW); 108 | 109 | // if sharing pins, you'll need to fix the directions of the touchscreen pins 110 | //pinMode(XP, OUTPUT); 111 | pinMode(XM, OUTPUT); 112 | pinMode(YP, OUTPUT); 113 | //pinMode(YM, OUTPUT); 114 | 115 | // we have some minimum pressure we consider 'valid' 116 | // pressure of 0 means no pressing! 117 | 118 | if (p.z > MINPRESSURE && p.z < MAXPRESSURE) { 119 | /* 120 | Serial.print("X = "); Serial.print(p.x); 121 | Serial.print("\tY = "); Serial.print(p.y); 122 | Serial.print("\tPressure = "); Serial.println(p.z); 123 | */ 124 | 125 | if (p.y < (TS_MINY-5)) { 126 | Serial.println("erase"); 127 | // press the bottom of the screen to erase 128 | tft.fillRect(0, BOXSIZE, tft.width(), tft.height()-BOXSIZE, BLACK); 129 | } 130 | // scale from 0->1023 to tft.width 131 | p.x = map(p.x, TS_MINX, TS_MAXX, tft.width(), 0); 132 | p.y = map(p.y, TS_MINY, TS_MAXY, tft.height(), 0); 133 | /* 134 | Serial.print("("); Serial.print(p.x); 135 | Serial.print(", "); Serial.print(p.y); 136 | Serial.println(")"); 137 | */ 138 | if (p.y < BOXSIZE) { 139 | oldcolor = currentcolor; 140 | 141 | if (p.x < BOXSIZE) { 142 | currentcolor = RED; 143 | tft.drawRect(0, 0, BOXSIZE, BOXSIZE, WHITE); 144 | } else if (p.x < BOXSIZE*2) { 145 | currentcolor = YELLOW; 146 | tft.drawRect(BOXSIZE, 0, BOXSIZE, BOXSIZE, WHITE); 147 | } else if (p.x < BOXSIZE*3) { 148 | currentcolor = GREEN; 149 | tft.drawRect(BOXSIZE*2, 0, BOXSIZE, BOXSIZE, WHITE); 150 | } else if (p.x < BOXSIZE*4) { 151 | currentcolor = CYAN; 152 | tft.drawRect(BOXSIZE*3, 0, BOXSIZE, BOXSIZE, WHITE); 153 | } else if (p.x < BOXSIZE*5) { 154 | currentcolor = BLUE; 155 | tft.drawRect(BOXSIZE*4, 0, BOXSIZE, BOXSIZE, WHITE); 156 | } else if (p.x < BOXSIZE*6) { 157 | currentcolor = MAGENTA; 158 | tft.drawRect(BOXSIZE*5, 0, BOXSIZE, BOXSIZE, WHITE); 159 | } 160 | 161 | if (oldcolor != currentcolor) { 162 | if (oldcolor == RED) tft.fillRect(0, 0, BOXSIZE, BOXSIZE, RED); 163 | if (oldcolor == YELLOW) tft.fillRect(BOXSIZE, 0, BOXSIZE, BOXSIZE, YELLOW); 164 | if (oldcolor == GREEN) tft.fillRect(BOXSIZE*2, 0, BOXSIZE, BOXSIZE, GREEN); 165 | if (oldcolor == CYAN) tft.fillRect(BOXSIZE*3, 0, BOXSIZE, BOXSIZE, CYAN); 166 | if (oldcolor == BLUE) tft.fillRect(BOXSIZE*4, 0, BOXSIZE, BOXSIZE, BLUE); 167 | if (oldcolor == MAGENTA) tft.fillRect(BOXSIZE*5, 0, BOXSIZE, BOXSIZE, MAGENTA); 168 | } 169 | } 170 | if (((p.y-PENRADIUS) > BOXSIZE) && ((p.y+PENRADIUS) < tft.height())) { 171 | tft.fillCircle(p.x, p.y, PENRADIUS, currentcolor); 172 | } 173 | } 174 | } 175 | 176 | -------------------------------------------------------------------------------- /libraries/SPFD5408 libraries/SPFD5408/examples/adafruit_originals/tftpaint_shield/tftpaint_shield.ino: -------------------------------------------------------------------------------- 1 | // Paint example specifically for the TFTLCD Arduino shield. 2 | // If using the breakout board, use the tftpaint.pde sketch instead! 3 | 4 | #include // Core graphics library 5 | #include // Hardware-specific library 6 | #include 7 | 8 | #if defined(__SAM3X8E__) 9 | #undef __FlashStringHelper::F(string_literal) 10 | #define F(string_literal) string_literal 11 | #endif 12 | 13 | #ifndef USE_ADAFRUIT_SHIELD_PINOUT 14 | #error "This sketch is intended for use with the TFT LCD Shield. Make sure that USE_ADAFRUIT_SHIELD_PINOUT is #defined in the Adafruit_TFTLCD.h library file." 15 | #endif 16 | 17 | // These are the pins for the shield! 18 | #define YP A1 // must be an analog pin, use "An" notation! 19 | #define XM A2 // must be an analog pin, use "An" notation! 20 | #define YM 7 // can be a digital pin 21 | #define XP 6 // can be a digital pin 22 | 23 | #ifdef __SAM3X8E__ 24 | #define TS_MINX 125 25 | #define TS_MINY 170 26 | #define TS_MAXX 880 27 | #define TS_MAXY 940 28 | #else 29 | #define TS_MINX 150 30 | #define TS_MINY 120 31 | #define TS_MAXX 920 32 | #define TS_MAXY 940 33 | #endif 34 | 35 | // For better pressure precision, we need to know the resistance 36 | // between X+ and X- Use any multimeter to read it 37 | // For the one we're using, its 300 ohms across the X plate 38 | TouchScreen ts = TouchScreen(XP, YP, XM, YM, 300); 39 | 40 | #define LCD_CS A3 41 | #define LCD_CD A2 42 | #define LCD_WR A1 43 | #define LCD_RD A0 44 | 45 | // Assign human-readable names to some common 16-bit color values: 46 | #define BLACK 0x0000 47 | #define BLUE 0x001F 48 | #define RED 0xF800 49 | #define GREEN 0x07E0 50 | #define CYAN 0x07FF 51 | #define MAGENTA 0xF81F 52 | #define YELLOW 0xFFE0 53 | #define WHITE 0xFFFF 54 | 55 | 56 | Adafruit_TFTLCD tft; 57 | 58 | #define BOXSIZE 40 59 | #define PENRADIUS 4 60 | int oldcolor, currentcolor; 61 | 62 | void setup(void) { 63 | Serial.begin(9600); 64 | Serial.println(F("Paint!")); 65 | 66 | tft.reset(); 67 | 68 | uint16_t identifier = tft.readID(); 69 | 70 | if(identifier == 0x9325) { 71 | Serial.println(F("Found ILI9325 LCD driver")); 72 | } else if(identifier == 0x9328) { 73 | Serial.println(F("Found ILI9328 LCD driver")); 74 | } else if(identifier == 0x7575) { 75 | Serial.println(F("Found HX8347G LCD driver")); 76 | } else { 77 | Serial.print(F("Unknown LCD driver chip: ")); 78 | Serial.println(identifier, HEX); 79 | return; 80 | } 81 | 82 | tft.begin(identifier); 83 | 84 | tft.fillScreen(BLACK); 85 | 86 | tft.fillRect(0, 0, BOXSIZE, BOXSIZE, RED); 87 | tft.fillRect(BOXSIZE, 0, BOXSIZE, BOXSIZE, YELLOW); 88 | tft.fillRect(BOXSIZE*2, 0, BOXSIZE, BOXSIZE, GREEN); 89 | tft.fillRect(BOXSIZE*3, 0, BOXSIZE, BOXSIZE, CYAN); 90 | tft.fillRect(BOXSIZE*4, 0, BOXSIZE, BOXSIZE, BLUE); 91 | tft.fillRect(BOXSIZE*5, 0, BOXSIZE, BOXSIZE, MAGENTA); 92 | // tft.fillRect(BOXSIZE*6, 0, BOXSIZE, BOXSIZE, WHITE); 93 | 94 | tft.drawRect(0, 0, BOXSIZE, BOXSIZE, WHITE); 95 | currentcolor = RED; 96 | 97 | pinMode(13, OUTPUT); 98 | } 99 | 100 | #define MINPRESSURE 10 101 | #define MAXPRESSURE 1000 102 | 103 | void loop() 104 | { 105 | digitalWrite(13, HIGH); 106 | TSPoint p = ts.getPoint(); 107 | digitalWrite(13, LOW); 108 | 109 | // if sharing pins, you'll need to fix the directions of the touchscreen pins 110 | //pinMode(XP, OUTPUT); 111 | pinMode(XM, OUTPUT); 112 | pinMode(YP, OUTPUT); 113 | //pinMode(YM, OUTPUT); 114 | 115 | // we have some minimum pressure we consider 'valid' 116 | // pressure of 0 means no pressing! 117 | 118 | if (p.z > MINPRESSURE && p.z < MAXPRESSURE) { 119 | /* 120 | Serial.print("X = "); Serial.print(p.x); 121 | Serial.print("\tY = "); Serial.print(p.y); 122 | Serial.print("\tPressure = "); Serial.println(p.z); 123 | */ 124 | 125 | if (p.y < (TS_MINY-5)) { 126 | Serial.println("erase"); 127 | // press the bottom of the screen to erase 128 | tft.fillRect(0, BOXSIZE, tft.width(), tft.height()-BOXSIZE, BLACK); 129 | } 130 | // scale from 0->1023 to tft.width 131 | p.x = map(p.x, TS_MINX, TS_MAXX, tft.width(), 0); 132 | p.y = map(p.y, TS_MINY, TS_MAXY, tft.height(), 0); 133 | /* 134 | Serial.print("("); Serial.print(p.x); 135 | Serial.print(", "); Serial.print(p.y); 136 | Serial.println(")"); 137 | */ 138 | if (p.y < BOXSIZE) { 139 | oldcolor = currentcolor; 140 | 141 | if (p.x < BOXSIZE) { 142 | currentcolor = RED; 143 | tft.drawRect(0, 0, BOXSIZE, BOXSIZE, WHITE); 144 | } else if (p.x < BOXSIZE*2) { 145 | currentcolor = YELLOW; 146 | tft.drawRect(BOXSIZE, 0, BOXSIZE, BOXSIZE, WHITE); 147 | } else if (p.x < BOXSIZE*3) { 148 | currentcolor = GREEN; 149 | tft.drawRect(BOXSIZE*2, 0, BOXSIZE, BOXSIZE, WHITE); 150 | } else if (p.x < BOXSIZE*4) { 151 | currentcolor = CYAN; 152 | tft.drawRect(BOXSIZE*3, 0, BOXSIZE, BOXSIZE, WHITE); 153 | } else if (p.x < BOXSIZE*5) { 154 | currentcolor = BLUE; 155 | tft.drawRect(BOXSIZE*4, 0, BOXSIZE, BOXSIZE, WHITE); 156 | } else if (p.x < BOXSIZE*6) { 157 | currentcolor = MAGENTA; 158 | tft.drawRect(BOXSIZE*5, 0, BOXSIZE, BOXSIZE, WHITE); 159 | } 160 | 161 | if (oldcolor != currentcolor) { 162 | if (oldcolor == RED) tft.fillRect(0, 0, BOXSIZE, BOXSIZE, RED); 163 | if (oldcolor == YELLOW) tft.fillRect(BOXSIZE, 0, BOXSIZE, BOXSIZE, YELLOW); 164 | if (oldcolor == GREEN) tft.fillRect(BOXSIZE*2, 0, BOXSIZE, BOXSIZE, GREEN); 165 | if (oldcolor == CYAN) tft.fillRect(BOXSIZE*3, 0, BOXSIZE, BOXSIZE, CYAN); 166 | if (oldcolor == BLUE) tft.fillRect(BOXSIZE*4, 0, BOXSIZE, BOXSIZE, BLUE); 167 | if (oldcolor == MAGENTA) tft.fillRect(BOXSIZE*5, 0, BOXSIZE, BOXSIZE, MAGENTA); 168 | } 169 | } 170 | if (((p.y-PENRADIUS) > BOXSIZE) && ((p.y+PENRADIUS) < tft.height())) { 171 | tft.fillCircle(p.x, p.y, PENRADIUS, currentcolor); 172 | } 173 | } 174 | } 175 | 176 | -------------------------------------------------------------------------------- /libraries/SPFD5408 libraries/SPFD5408_TFT_Library/examples/rotationtest/rotationtest.pde: -------------------------------------------------------------------------------- 1 | // IMPORTANT: TftSpfd5408 LIBRARY MUST BE SPECIFICALLY 2 | // CONFIGURED FOR EITHER THE TFT SHIELD OR THE BREAKOUT BOARD. 3 | // SEE RELEVANT COMMENTS IN TftSpfd5408.h FOR SETUP. 4 | 5 | #include // Core graphics library 6 | #include // Hardware-specific library 7 | 8 | // The control pins for the LCD can be assigned to any digital or 9 | // analog pins...but we'll use the analog pins as this allows us to 10 | // double up the pins with the touch screen (see the TFT paint example). 11 | #define LCD_CS A3 // Chip Select goes to Analog 3 12 | #define LCD_CD A2 // Command/Data goes to Analog 2 13 | #define LCD_WR A1 // LCD Write goes to Analog 1 14 | #define LCD_RD A0 // LCD Read goes to Analog 0 15 | 16 | #define LCD_RESET A4 // Can alternately just connect to Arduino's reset pin 17 | 18 | // When using the BREAKOUT BOARD only, use these 8 data lines to the LCD: 19 | // For the Arduino Uno, Duemilanove, Diecimila, etc.: 20 | // D0 connects to digital pin 8 (Notice these are 21 | // D1 connects to digital pin 9 NOT in order!) 22 | // D2 connects to digital pin 2 23 | // D3 connects to digital pin 3 24 | // D4 connects to digital pin 4 25 | // D5 connects to digital pin 5 26 | // D6 connects to digital pin 6 27 | // D7 connects to digital pin 7 28 | // For the Arduino Mega, use digital pins 22 through 29 29 | // (on the 2-row header at the end of the board). 30 | 31 | // Assign human-readable names to some common 16-bit color values: 32 | #define BLACK 0x0000 33 | #define BLUE 0x001F 34 | #define RED 0xF800 35 | #define GREEN 0x07E0 36 | #define CYAN 0x07FF 37 | #define MAGENTA 0xF81F 38 | #define YELLOW 0xFFE0 39 | #define WHITE 0xFFFF 40 | 41 | TftSpfd5408 tft(LCD_CS, LCD_CD, LCD_WR, LCD_RD, LCD_RESET); 42 | // If using the shield, all control and data lines are fixed, and 43 | // a simpler declaration can optionally be used: 44 | // TftSpfd5408 tft; 45 | 46 | void setup(void) { 47 | Serial.begin(9600); 48 | Serial.println(F("TFT LCD test")); 49 | 50 | #ifdef USE_ADAFRUIT_SHIELD_PINOUT 51 | Serial.println(F("Using Adafruit 2.8\" TFT Arduino Shield Pinout")); 52 | #else 53 | Serial.println(F("Using Adafruit 2.8\" TFT Breakout Board Pinout")); 54 | #endif 55 | 56 | tft.reset(); 57 | 58 | tft.begin(0x9341); 59 | 60 | tft.fillScreen(BLACK); 61 | 62 | Serial.println(F("This is a test of the rotation capabilities of the TFT library!")); 63 | Serial.println(F("Press (or type a character) to advance")); 64 | } 65 | 66 | void loop(void) { 67 | rotatePixel(); 68 | rotateLine(); 69 | rotateFastline(); 70 | rotateDrawrect(); 71 | rotateFillrect(); 72 | rotateDrawcircle(); 73 | rotateFillcircle(); 74 | rotateText(); 75 | } 76 | 77 | void rotateText() { 78 | for (uint8_t i=0; i<4; i++) { 79 | tft.fillScreen(BLACK); 80 | Serial.println(tft.getRotation(), DEC); 81 | 82 | tft.setCursor(0, 30); 83 | tft.setTextColor(RED); 84 | tft.setTextSize(1); 85 | tft.println("Hello World!"); 86 | tft.setTextColor(YELLOW); 87 | tft.setTextSize(2); 88 | tft.println("Hello World!"); 89 | tft.setTextColor(GREEN); 90 | tft.setTextSize(3); 91 | tft.println("Hello World!"); 92 | tft.setTextColor(BLUE); 93 | tft.setTextSize(4); 94 | tft.print(1234.567); 95 | 96 | while (!Serial.available()); 97 | Serial.read(); Serial.read(); Serial.read(); 98 | 99 | tft.setRotation(tft.getRotation()+1); 100 | } 101 | } 102 | 103 | void rotateFillcircle(void) { 104 | for (uint8_t i=0; i<4; i++) { 105 | tft.fillScreen(BLACK); 106 | Serial.println(tft.getRotation(), DEC); 107 | 108 | tft.fillCircle(10, 30, 10, YELLOW); 109 | 110 | while (!Serial.available()); 111 | Serial.read(); Serial.read(); Serial.read(); 112 | 113 | tft.setRotation(tft.getRotation()+1); 114 | } 115 | } 116 | 117 | void rotateDrawcircle(void) { 118 | for (uint8_t i=0; i<4; i++) { 119 | tft.fillScreen(BLACK); 120 | Serial.println(tft.getRotation(), DEC); 121 | 122 | tft.drawCircle(10, 30, 10, YELLOW); 123 | 124 | while (!Serial.available()); 125 | Serial.read(); Serial.read(); Serial.read(); 126 | 127 | tft.setRotation(tft.getRotation()+1); 128 | } 129 | } 130 | 131 | void rotateFillrect(void) { 132 | for (uint8_t i=0; i<4; i++) { 133 | tft.fillScreen(BLACK); 134 | Serial.println(tft.getRotation(), DEC); 135 | 136 | tft.fillRect(10, 20, 10, 20, GREEN); 137 | 138 | while (!Serial.available()); 139 | Serial.read(); Serial.read(); Serial.read(); 140 | 141 | tft.setRotation(tft.getRotation()+1); 142 | } 143 | } 144 | 145 | void rotateDrawrect(void) { 146 | for (uint8_t i=0; i<4; i++) { 147 | tft.fillScreen(BLACK); 148 | Serial.println(tft.getRotation(), DEC); 149 | 150 | tft.drawRect(10, 20, 10, 20, GREEN); 151 | 152 | while (!Serial.available()); 153 | Serial.read(); Serial.read(); Serial.read(); 154 | 155 | tft.setRotation(tft.getRotation()+1); 156 | } 157 | } 158 | 159 | void rotateFastline(void) { 160 | for (uint8_t i=0; i<4; i++) { 161 | tft.fillScreen(BLACK); 162 | Serial.println(tft.getRotation(), DEC); 163 | 164 | tft.drawFastHLine(0, 20, tft.width(), RED); 165 | tft.drawFastVLine(20, 0, tft.height(), BLUE); 166 | 167 | while (!Serial.available()); 168 | Serial.read(); Serial.read(); Serial.read(); 169 | 170 | tft.setRotation(tft.getRotation()+1); 171 | } 172 | } 173 | 174 | void rotateLine(void) { 175 | for (uint8_t i=0; i<4; i++) { 176 | tft.fillScreen(BLACK); 177 | Serial.println(tft.getRotation(), DEC); 178 | 179 | tft.drawLine(tft.width()/2, tft.height()/2, 0, 0, RED); 180 | while (!Serial.available()); 181 | Serial.read(); Serial.read(); Serial.read(); 182 | 183 | tft.setRotation(tft.getRotation()+1); 184 | } 185 | } 186 | 187 | void rotatePixel(void) { 188 | for (uint8_t i=0; i<4; i++) { 189 | tft.fillScreen(BLACK); 190 | Serial.println(tft.getRotation(), DEC); 191 | 192 | tft.drawPixel(10,20, RED); 193 | while (!Serial.available()); 194 | Serial.read(); Serial.read(); Serial.read(); 195 | 196 | tft.setRotation(tft.getRotation()+1); 197 | } 198 | } 199 | 200 | -------------------------------------------------------------------------------- /libraries/SPFD5408 libraries/SPFD5408/examples/adafruit_originals/tftpaint_shield/tftpaint_shield.pde: -------------------------------------------------------------------------------- 1 | // Paint example specifically for the TFTLCD Arduino shield. 2 | // If using the breakout board, use the tftpaint.pde sketch instead! 3 | 4 | #include // Core graphics library 5 | #include // Hardware-specific library 6 | #include 7 | 8 | #ifndef USE_ADAFRUIT_SHIELD_PINOUT 9 | #error "This sketch is intended for use with the TFT LCD Shield. Make sure that USE_ADAFRUIT_SHIELD_PINOUT is #defined in the Adafruit_TFTLCD.h library file." 10 | #endif 11 | 12 | // These are the pins for the shield! 13 | #define YP A1 // must be an analog pin, use "An" notation! 14 | #define XM A2 // must be an analog pin, use "An" notation! 15 | #define YM 7 // can be a digital pin 16 | #define XP 6 // can be a digital pin 17 | 18 | #define TS_MINX 150 19 | #define TS_MINY 120 20 | #define TS_MAXX 920 21 | #define TS_MAXY 940 22 | 23 | // For better pressure precision, we need to know the resistance 24 | // between X+ and X- Use any multimeter to read it 25 | // For the one we're using, its 300 ohms across the X plate 26 | TouchScreen ts = TouchScreen(XP, YP, XM, YM, 300); 27 | 28 | #define LCD_CS A3 29 | #define LCD_CD A2 30 | #define LCD_WR A1 31 | #define LCD_RD A0 32 | 33 | // Assign human-readable names to some common 16-bit color values: 34 | #define BLACK 0x0000 35 | #define BLUE 0x001F 36 | #define RED 0xF800 37 | #define GREEN 0x07E0 38 | #define CYAN 0x07FF 39 | #define MAGENTA 0xF81F 40 | #define YELLOW 0xFFE0 41 | #define WHITE 0xFFFF 42 | 43 | 44 | Adafruit_TFTLCD tft; 45 | 46 | #define BOXSIZE 40 47 | #define PENRADIUS 4 48 | int oldcolor, currentcolor; 49 | 50 | void setup(void) { 51 | Serial.begin(9600); 52 | progmemPrintln(PSTR("Paint!")); 53 | 54 | tft.reset(); 55 | 56 | uint16_t identifier = tft.readID(); 57 | 58 | if(identifier == 0x9325) { 59 | progmemPrintln(PSTR("Found ILI9325 LCD driver")); 60 | } else if(identifier == 0x9328) { 61 | progmemPrintln(PSTR("Found ILI9328 LCD driver")); 62 | } else if(identifier == 0x7575) { 63 | progmemPrintln(PSTR("Found HX8347G LCD driver")); 64 | } else { 65 | progmemPrint(PSTR("Unknown LCD driver chip: ")); 66 | Serial.println(identifier, HEX); 67 | return; 68 | } 69 | 70 | tft.begin(identifier); 71 | 72 | tft.fillScreen(BLACK); 73 | 74 | tft.fillRect(0, 0, BOXSIZE, BOXSIZE, RED); 75 | tft.fillRect(BOXSIZE, 0, BOXSIZE, BOXSIZE, YELLOW); 76 | tft.fillRect(BOXSIZE*2, 0, BOXSIZE, BOXSIZE, GREEN); 77 | tft.fillRect(BOXSIZE*3, 0, BOXSIZE, BOXSIZE, CYAN); 78 | tft.fillRect(BOXSIZE*4, 0, BOXSIZE, BOXSIZE, BLUE); 79 | tft.fillRect(BOXSIZE*5, 0, BOXSIZE, BOXSIZE, MAGENTA); 80 | // tft.fillRect(BOXSIZE*6, 0, BOXSIZE, BOXSIZE, WHITE); 81 | 82 | tft.drawRect(0, 0, BOXSIZE, BOXSIZE, WHITE); 83 | currentcolor = RED; 84 | 85 | pinMode(13, OUTPUT); 86 | } 87 | 88 | #define MINPRESSURE 10 89 | #define MAXPRESSURE 1000 90 | 91 | void loop() 92 | { 93 | digitalWrite(13, HIGH); 94 | Point p = ts.getPoint(); 95 | digitalWrite(13, LOW); 96 | 97 | // if sharing pins, you'll need to fix the directions of the touchscreen pins 98 | //pinMode(XP, OUTPUT); 99 | pinMode(XM, OUTPUT); 100 | pinMode(YP, OUTPUT); 101 | //pinMode(YM, OUTPUT); 102 | 103 | // we have some minimum pressure we consider 'valid' 104 | // pressure of 0 means no pressing! 105 | 106 | if (p.z > MINPRESSURE && p.z < MAXPRESSURE) { 107 | /* 108 | Serial.print("X = "); Serial.print(p.x); 109 | Serial.print("\tY = "); Serial.print(p.y); 110 | Serial.print("\tPressure = "); Serial.println(p.z); 111 | */ 112 | 113 | if (p.y < (TS_MINY-5)) { 114 | Serial.println("erase"); 115 | // press the bottom of the screen to erase 116 | tft.fillRect(0, BOXSIZE, tft.width(), tft.height()-BOXSIZE, BLACK); 117 | } 118 | // scale from 0->1023 to tft.width 119 | p.x = map(p.x, TS_MINX, TS_MAXX, tft.width(), 0); 120 | p.y = map(p.y, TS_MINY, TS_MAXY, tft.height(), 0); 121 | /* 122 | Serial.print("("); Serial.print(p.x); 123 | Serial.print(", "); Serial.print(p.y); 124 | Serial.println(")"); 125 | */ 126 | if (p.y < BOXSIZE) { 127 | oldcolor = currentcolor; 128 | 129 | if (p.x < BOXSIZE) { 130 | currentcolor = RED; 131 | tft.drawRect(0, 0, BOXSIZE, BOXSIZE, WHITE); 132 | } else if (p.x < BOXSIZE*2) { 133 | currentcolor = YELLOW; 134 | tft.drawRect(BOXSIZE, 0, BOXSIZE, BOXSIZE, WHITE); 135 | } else if (p.x < BOXSIZE*3) { 136 | currentcolor = GREEN; 137 | tft.drawRect(BOXSIZE*2, 0, BOXSIZE, BOXSIZE, WHITE); 138 | } else if (p.x < BOXSIZE*4) { 139 | currentcolor = CYAN; 140 | tft.drawRect(BOXSIZE*3, 0, BOXSIZE, BOXSIZE, WHITE); 141 | } else if (p.x < BOXSIZE*5) { 142 | currentcolor = BLUE; 143 | tft.drawRect(BOXSIZE*4, 0, BOXSIZE, BOXSIZE, WHITE); 144 | } else if (p.x < BOXSIZE*6) { 145 | currentcolor = MAGENTA; 146 | tft.drawRect(BOXSIZE*5, 0, BOXSIZE, BOXSIZE, WHITE); 147 | } 148 | 149 | if (oldcolor != currentcolor) { 150 | if (oldcolor == RED) tft.fillRect(0, 0, BOXSIZE, BOXSIZE, RED); 151 | if (oldcolor == YELLOW) tft.fillRect(BOXSIZE, 0, BOXSIZE, BOXSIZE, YELLOW); 152 | if (oldcolor == GREEN) tft.fillRect(BOXSIZE*2, 0, BOXSIZE, BOXSIZE, GREEN); 153 | if (oldcolor == CYAN) tft.fillRect(BOXSIZE*3, 0, BOXSIZE, BOXSIZE, CYAN); 154 | if (oldcolor == BLUE) tft.fillRect(BOXSIZE*4, 0, BOXSIZE, BOXSIZE, BLUE); 155 | if (oldcolor == MAGENTA) tft.fillRect(BOXSIZE*5, 0, BOXSIZE, BOXSIZE, MAGENTA); 156 | } 157 | } 158 | if (((p.y-PENRADIUS) > BOXSIZE) && ((p.y+PENRADIUS) < tft.height())) { 159 | tft.fillCircle(p.x, p.y, PENRADIUS, currentcolor); 160 | } 161 | } 162 | } 163 | 164 | // Copy string from flash to serial port 165 | // Source string MUST be inside a PSTR() declaration! 166 | void progmemPrint(const char *str) { 167 | char c; 168 | while(c = pgm_read_byte(str++)) Serial.print(c); 169 | } 170 | 171 | // Same as above, with trailing newline 172 | void progmemPrintln(const char *str) { 173 | progmemPrint(str); 174 | Serial.println(); 175 | } 176 | 177 | -------------------------------------------------------------------------------- /libraries/Adafruit libraries/TouchScreen/TouchScreen.cpp: -------------------------------------------------------------------------------- 1 | // Touch screen library with X Y and Z (pressure) readings as well 2 | // as oversampling to avoid 'bouncing' 3 | // (c) ladyada / adafruit 4 | // Code under MIT License 5 | 6 | #include "pins_arduino.h" 7 | #include "wiring_private.h" 8 | #include 9 | #include "TouchScreen.h" 10 | 11 | // increase or decrease the touchscreen oversampling. This is a little different than you make think: 12 | // 1 is no oversampling, whatever data we get is immediately returned 13 | // 2 is double-sampling and we only return valid data if both points are the same 14 | // 3+ uses insert sort to get the median value. 15 | // We found 2 is precise yet not too slow so we suggest sticking with it! 16 | 17 | #define NUMSAMPLES 2 18 | 19 | TSPoint::TSPoint(void) { 20 | x = y = 0; 21 | } 22 | 23 | TSPoint::TSPoint(int16_t x0, int16_t y0, int16_t z0) { 24 | x = x0; 25 | y = y0; 26 | z = z0; 27 | } 28 | 29 | bool TSPoint::operator==(TSPoint p1) { 30 | return ((p1.x == x) && (p1.y == y) && (p1.z == z)); 31 | } 32 | 33 | bool TSPoint::operator!=(TSPoint p1) { 34 | return ((p1.x != x) || (p1.y != y) || (p1.z != z)); 35 | } 36 | 37 | #if (NUMSAMPLES > 2) 38 | static void insert_sort(int array[], uint8_t size) { 39 | uint8_t j; 40 | int save; 41 | 42 | for (int i = 1; i < size; i++) { 43 | save = array[i]; 44 | for (j = i; j >= 1 && save < array[j - 1]; j--) 45 | array[j] = array[j - 1]; 46 | array[j] = save; 47 | } 48 | } 49 | #endif 50 | 51 | TSPoint TouchScreen::getPoint(void) { 52 | int x, y, z; 53 | int samples[NUMSAMPLES]; 54 | uint8_t i, valid; 55 | 56 | 57 | uint8_t xp_port = digitalPinToPort(_xp); 58 | uint8_t yp_port = digitalPinToPort(_yp); 59 | uint8_t xm_port = digitalPinToPort(_xm); 60 | uint8_t ym_port = digitalPinToPort(_ym); 61 | 62 | uint8_t xp_pin = digitalPinToBitMask(_xp); 63 | uint8_t yp_pin = digitalPinToBitMask(_yp); 64 | uint8_t xm_pin = digitalPinToBitMask(_xm); 65 | uint8_t ym_pin = digitalPinToBitMask(_ym); 66 | 67 | 68 | valid = 1; 69 | 70 | pinMode(_yp, INPUT); 71 | pinMode(_ym, INPUT); 72 | 73 | *portOutputRegister(yp_port) &= ~yp_pin; 74 | *portOutputRegister(ym_port) &= ~ym_pin; 75 | //digitalWrite(_yp, LOW); 76 | //digitalWrite(_ym, LOW); 77 | 78 | pinMode(_xp, OUTPUT); 79 | pinMode(_xm, OUTPUT); 80 | //digitalWrite(_xp, HIGH); 81 | //digitalWrite(_xm, LOW); 82 | *portOutputRegister(xp_port) |= xp_pin; 83 | *portOutputRegister(xm_port) &= ~xm_pin; 84 | 85 | for (i=0; i 2 89 | insert_sort(samples, NUMSAMPLES); 90 | #endif 91 | #if NUMSAMPLES == 2 92 | if (samples[0] != samples[1]) { valid = 0; } 93 | #endif 94 | x = (1023-samples[NUMSAMPLES/2]); 95 | 96 | pinMode(_xp, INPUT); 97 | pinMode(_xm, INPUT); 98 | *portOutputRegister(xp_port) &= ~xp_pin; 99 | //digitalWrite(_xp, LOW); 100 | 101 | pinMode(_yp, OUTPUT); 102 | *portOutputRegister(yp_port) |= yp_pin; 103 | //digitalWrite(_yp, HIGH); 104 | pinMode(_ym, OUTPUT); 105 | 106 | for (i=0; i 2 111 | insert_sort(samples, NUMSAMPLES); 112 | #endif 113 | #if NUMSAMPLES == 2 114 | if (samples[0] != samples[1]) { valid = 0; } 115 | #endif 116 | 117 | y = (1023-samples[NUMSAMPLES/2]); 118 | 119 | // Set X+ to ground 120 | pinMode(_xp, OUTPUT); 121 | *portOutputRegister(xp_port) &= ~xp_pin; 122 | //digitalWrite(_xp, LOW); 123 | 124 | // Set Y- to VCC 125 | *portOutputRegister(ym_port) |= ym_pin; 126 | //digitalWrite(_ym, HIGH); 127 | 128 | // Hi-Z X- and Y+ 129 | *portOutputRegister(yp_port) &= ~yp_pin; 130 | //digitalWrite(_yp, LOW); 131 | pinMode(_yp, INPUT); 132 | 133 | int z1 = analogRead(_xm); 134 | int z2 = analogRead(_yp); 135 | 136 | if (_rxplate != 0) { 137 | // now read the x 138 | float rtouch; 139 | rtouch = z2; 140 | rtouch /= z1; 141 | rtouch -= 1; 142 | rtouch *= x; 143 | rtouch *= _rxplate; 144 | rtouch /= 1024; 145 | 146 | z = rtouch; 147 | } else { 148 | z = (1023-(z2-z1)); 149 | } 150 | 151 | if (! valid) { 152 | z = 0; 153 | } 154 | 155 | return TSPoint(x, y, z); 156 | } 157 | 158 | TouchScreen::TouchScreen(uint8_t xp, uint8_t yp, uint8_t xm, uint8_t ym) { 159 | _yp = yp; 160 | _xm = xm; 161 | _ym = ym; 162 | _xp = xp; 163 | _rxplate = 0; 164 | pressureThreshhold = 10; 165 | } 166 | 167 | 168 | TouchScreen::TouchScreen(uint8_t xp, uint8_t yp, uint8_t xm, uint8_t ym, 169 | uint16_t rxplate) { 170 | _yp = yp; 171 | _xm = xm; 172 | _ym = ym; 173 | _xp = xp; 174 | _rxplate = rxplate; 175 | 176 | pressureThreshhold = 10; 177 | } 178 | 179 | int TouchScreen::readTouchX(void) { 180 | pinMode(_yp, INPUT); 181 | pinMode(_ym, INPUT); 182 | digitalWrite(_yp, LOW); 183 | digitalWrite(_ym, LOW); 184 | 185 | pinMode(_xp, OUTPUT); 186 | digitalWrite(_xp, HIGH); 187 | pinMode(_xm, OUTPUT); 188 | digitalWrite(_xm, LOW); 189 | 190 | return (1023-analogRead(_yp)); 191 | } 192 | 193 | 194 | int TouchScreen::readTouchY(void) { 195 | pinMode(_xp, INPUT); 196 | pinMode(_xm, INPUT); 197 | digitalWrite(_xp, LOW); 198 | digitalWrite(_xm, LOW); 199 | 200 | pinMode(_yp, OUTPUT); 201 | digitalWrite(_yp, HIGH); 202 | pinMode(_ym, OUTPUT); 203 | digitalWrite(_ym, LOW); 204 | 205 | return (1023-analogRead(_xm)); 206 | } 207 | 208 | 209 | uint16_t TouchScreen::pressure(void) { 210 | // Set X+ to ground 211 | pinMode(_xp, OUTPUT); 212 | digitalWrite(_xp, LOW); 213 | 214 | // Set Y- to VCC 215 | pinMode(_ym, OUTPUT); 216 | digitalWrite(_ym, HIGH); 217 | 218 | // Hi-Z X- and Y+ 219 | digitalWrite(_xm, LOW); 220 | pinMode(_xm, INPUT); 221 | digitalWrite(_yp, LOW); 222 | pinMode(_yp, INPUT); 223 | 224 | int z1 = analogRead(_xm); 225 | int z2 = analogRead(_yp); 226 | 227 | if (_rxplate != 0) { 228 | // now read the x 229 | float rtouch; 230 | rtouch = z2; 231 | rtouch /= z1; 232 | rtouch -= 1; 233 | rtouch *= readTouchX(); 234 | rtouch *= _rxplate; 235 | rtouch /= 1024; 236 | 237 | return rtouch; 238 | } else { 239 | return (1023-(z2-z1)); 240 | } 241 | } 242 | -------------------------------------------------------------------------------- /libraries/SPFD5408 libraries/SPFD5408/SPFD5408_TouchScreen.cpp: -------------------------------------------------------------------------------- 1 | // Touch screen library with X Y and Z (pressure) readings as well 2 | // as oversampling to avoid 'bouncing' 3 | // (c) ladyada / adafruit 4 | // Code under MIT License 5 | 6 | #include "pins_arduino.h" 7 | #include "wiring_private.h" 8 | #ifdef __AVR 9 | #include 10 | #elif defined(ESP8266) 11 | #include 12 | #endif 13 | #include "SPFD5408_TouchScreen.h" 14 | 15 | // increase or decrease the touchscreen oversampling. This is a little different than you make think: 16 | // 1 is no oversampling, whatever data we get is immediately returned 17 | // 2 is double-sampling and we only return valid data if both points are the same 18 | // 3+ uses insert sort to get the median value. 19 | // We found 2 is precise yet not too slow so we suggest sticking with it! 20 | 21 | #define NUMSAMPLES 2 22 | 23 | TSPoint::TSPoint(void) { 24 | x = y = 0; 25 | } 26 | 27 | TSPoint::TSPoint(int16_t x0, int16_t y0, int16_t z0) { 28 | x = x0; 29 | y = y0; 30 | z = z0; 31 | } 32 | 33 | bool TSPoint::operator==(TSPoint p1) { 34 | return ((p1.x == x) && (p1.y == y) && (p1.z == z)); 35 | } 36 | 37 | bool TSPoint::operator!=(TSPoint p1) { 38 | return ((p1.x != x) || (p1.y != y) || (p1.z != z)); 39 | } 40 | 41 | #if (NUMSAMPLES > 2) 42 | static void insert_sort(int array[], uint8_t size) { 43 | uint8_t j; 44 | int save; 45 | 46 | for (int i = 1; i < size; i++) { 47 | save = array[i]; 48 | for (j = i; j >= 1 && save < array[j - 1]; j--) 49 | array[j] = array[j - 1]; 50 | array[j] = save; 51 | } 52 | } 53 | #endif 54 | 55 | TSPoint TouchScreen::getPoint(void) { 56 | int x, y, z; 57 | int samples[NUMSAMPLES]; 58 | uint8_t i, valid; 59 | 60 | 61 | uint8_t xp_port = digitalPinToPort(_xp); 62 | uint8_t yp_port = digitalPinToPort(_yp); 63 | uint8_t xm_port = digitalPinToPort(_xm); 64 | uint8_t ym_port = digitalPinToPort(_ym); 65 | 66 | uint8_t xp_pin = digitalPinToBitMask(_xp); 67 | uint8_t yp_pin = digitalPinToBitMask(_yp); 68 | uint8_t xm_pin = digitalPinToBitMask(_xm); 69 | uint8_t ym_pin = digitalPinToBitMask(_ym); 70 | 71 | 72 | valid = 1; 73 | 74 | pinMode(_yp, INPUT); 75 | pinMode(_ym, INPUT); 76 | 77 | *portOutputRegister(yp_port) &= ~yp_pin; 78 | *portOutputRegister(ym_port) &= ~ym_pin; 79 | //digitalWrite(_yp, LOW); 80 | //digitalWrite(_ym, LOW); 81 | 82 | pinMode(_xp, OUTPUT); 83 | pinMode(_xm, OUTPUT); 84 | //digitalWrite(_xp, HIGH); 85 | //digitalWrite(_xm, LOW); 86 | *portOutputRegister(xp_port) |= xp_pin; 87 | *portOutputRegister(xm_port) &= ~xm_pin; 88 | 89 | for (i=0; i 2 93 | insert_sort(samples, NUMSAMPLES); 94 | #endif 95 | #if NUMSAMPLES == 2 96 | if (samples[0] != samples[1]) { valid = 0; } 97 | #endif 98 | x = (1023-samples[NUMSAMPLES/2]); 99 | 100 | pinMode(_xp, INPUT); 101 | pinMode(_xm, INPUT); 102 | *portOutputRegister(xp_port) &= ~xp_pin; 103 | //digitalWrite(_xp, LOW); 104 | 105 | pinMode(_yp, OUTPUT); 106 | *portOutputRegister(yp_port) |= yp_pin; 107 | //digitalWrite(_yp, HIGH); 108 | pinMode(_ym, OUTPUT); 109 | 110 | for (i=0; i 2 115 | insert_sort(samples, NUMSAMPLES); 116 | #endif 117 | #if NUMSAMPLES == 2 118 | if (samples[0] != samples[1]) { valid = 0; } 119 | #endif 120 | 121 | y = (1023-samples[NUMSAMPLES/2]); 122 | 123 | // Set X+ to ground 124 | pinMode(_xp, OUTPUT); 125 | *portOutputRegister(xp_port) &= ~xp_pin; 126 | //digitalWrite(_xp, LOW); 127 | 128 | // Set Y- to VCC 129 | *portOutputRegister(ym_port) |= ym_pin; 130 | //digitalWrite(_ym, HIGH); 131 | 132 | // Hi-Z X- and Y+ 133 | *portOutputRegister(yp_port) &= ~yp_pin; 134 | //digitalWrite(_yp, LOW); 135 | pinMode(_yp, INPUT); 136 | 137 | int z1 = analogRead(_xm); 138 | int z2 = analogRead(_yp); 139 | 140 | if (_rxplate != 0) { 141 | // now read the x 142 | float rtouch; 143 | rtouch = z2; 144 | rtouch /= z1; 145 | rtouch -= 1; 146 | rtouch *= x; 147 | rtouch *= _rxplate; 148 | rtouch /= 1024; 149 | 150 | z = rtouch; 151 | } else { 152 | z = (1023-(z2-z1)); 153 | } 154 | 155 | if (! valid) { 156 | z = 0; 157 | } 158 | 159 | //return TSPoint(x, y, z); 160 | 161 | // *** SPFD5408 change -- Begin 162 | // SPFD5408 change, because Y coordinate is inverted in this controller 163 | return TSPoint(x, 1023 - y, z); 164 | // -- End 165 | } 166 | 167 | TouchScreen::TouchScreen(uint8_t xp, uint8_t yp, uint8_t xm, uint8_t ym) { 168 | _yp = yp; 169 | _xm = xm; 170 | _ym = ym; 171 | _xp = xp; 172 | _rxplate = 0; 173 | pressureThreshhold = 10; 174 | } 175 | 176 | 177 | TouchScreen::TouchScreen(uint8_t xp, uint8_t yp, uint8_t xm, uint8_t ym, 178 | uint16_t rxplate) { 179 | _yp = yp; 180 | _xm = xm; 181 | _ym = ym; 182 | _xp = xp; 183 | _rxplate = rxplate; 184 | 185 | pressureThreshhold = 10; 186 | } 187 | 188 | int TouchScreen::readTouchX(void) { 189 | pinMode(_yp, INPUT); 190 | pinMode(_ym, INPUT); 191 | digitalWrite(_yp, LOW); 192 | digitalWrite(_ym, LOW); 193 | 194 | pinMode(_xp, OUTPUT); 195 | digitalWrite(_xp, HIGH); 196 | pinMode(_xm, OUTPUT); 197 | digitalWrite(_xm, LOW); 198 | 199 | return (1023-analogRead(_yp)); 200 | } 201 | 202 | 203 | int TouchScreen::readTouchY(void) { 204 | pinMode(_xp, INPUT); 205 | pinMode(_xm, INPUT); 206 | digitalWrite(_xp, LOW); 207 | digitalWrite(_xm, LOW); 208 | 209 | pinMode(_yp, OUTPUT); 210 | digitalWrite(_yp, HIGH); 211 | pinMode(_ym, OUTPUT); 212 | digitalWrite(_ym, LOW); 213 | 214 | return (1023-analogRead(_xm)); 215 | } 216 | 217 | 218 | uint16_t TouchScreen::pressure(void) { 219 | // Set X+ to ground 220 | pinMode(_xp, OUTPUT); 221 | digitalWrite(_xp, LOW); 222 | 223 | // Set Y- to VCC 224 | pinMode(_ym, OUTPUT); 225 | digitalWrite(_ym, HIGH); 226 | 227 | // Hi-Z X- and Y+ 228 | digitalWrite(_xm, LOW); 229 | pinMode(_xm, INPUT); 230 | digitalWrite(_yp, LOW); 231 | pinMode(_yp, INPUT); 232 | 233 | int z1 = analogRead(_xm); 234 | int z2 = analogRead(_yp); 235 | 236 | if (_rxplate != 0) { 237 | // now read the x 238 | float rtouch; 239 | rtouch = z2; 240 | rtouch /= z1; 241 | rtouch -= 1; 242 | rtouch *= readTouchX(); 243 | rtouch *= _rxplate; 244 | rtouch /= 1024; 245 | 246 | return rtouch; 247 | } else { 248 | return (1023-(z2-z1)); 249 | } 250 | } 251 | -------------------------------------------------------------------------------- /libraries/SPFD5408 libraries/SPFD5408_TFT_Library/examples/tftpaint/tftpaint.ino: -------------------------------------------------------------------------------- 1 | // Paint example specifically for the TFTLCD breakout board. 2 | // If using the Arduino shield, use the tftpaint_shield.pde sketch instead! 3 | // DOES NOT CURRENTLY WORK ON ARDUINO LEONARDO 4 | 5 | #include // Core graphics library 6 | #include // Hardware-specific library 7 | #include 8 | 9 | #if defined(__SAM3X8E__) 10 | #undef __FlashStringHelper::F(string_literal) 11 | #define F(string_literal) string_literal 12 | #endif 13 | 14 | // When using the BREAKOUT BOARD only, use these 8 data lines to the LCD: 15 | // For the Arduino Uno, Duemilanove, Diecimila, etc.: 16 | // D0 connects to digital pin 8 (Notice these are 17 | // D1 connects to digital pin 9 NOT in order!) 18 | // D2 connects to digital pin 2 19 | // D3 connects to digital pin 3 20 | // D4 connects to digital pin 4 21 | // D5 connects to digital pin 5 22 | // D6 connects to digital pin 6 23 | // D7 connects to digital pin 7 24 | 25 | // For the Arduino Mega, use digital pins 22 through 29 26 | // (on the 2-row header at the end of the board). 27 | // D0 connects to digital pin 22 28 | // D1 connects to digital pin 23 29 | // D2 connects to digital pin 24 30 | // D3 connects to digital pin 25 31 | // D4 connects to digital pin 26 32 | // D5 connects to digital pin 27 33 | // D6 connects to digital pin 28 34 | // D7 connects to digital pin 29 35 | 36 | // For the Arduino Due, use digital pins 33 through 40 37 | // (on the 2-row header at the end of the board). 38 | // D0 connects to digital pin 33 39 | // D1 connects to digital pin 34 40 | // D2 connects to digital pin 35 41 | // D3 connects to digital pin 36 42 | // D4 connects to digital pin 37 43 | // D5 connects to digital pin 38 44 | // D6 connects to digital pin 39 45 | // D7 connects to digital pin 40 46 | 47 | #define YP A3 // must be an analog pin, use "An" notation! 48 | #define XM A2 // must be an analog pin, use "An" notation! 49 | #define YM 9 // can be a digital pin 50 | #define XP 8 // can be a digital pin 51 | 52 | #define TS_MINX 150 53 | #define TS_MINY 120 54 | #define TS_MAXX 920 55 | #define TS_MAXY 940 56 | 57 | // For better pressure precision, we need to know the resistance 58 | // between X+ and X- Use any multimeter to read it 59 | // For the one we're using, its 300 ohms across the X plate 60 | TouchScreen ts = TouchScreen(XP, YP, XM, YM, 300); 61 | 62 | #define LCD_CS A3 63 | #define LCD_CD A2 64 | #define LCD_WR A1 65 | #define LCD_RD A0 66 | // optional 67 | #define LCD_RESET A4 68 | 69 | // Assign human-readable names to some common 16-bit color values: 70 | #define BLACK 0x0000 71 | #define BLUE 0x001F 72 | #define RED 0xF800 73 | #define GREEN 0x07E0 74 | #define CYAN 0x07FF 75 | #define MAGENTA 0xF81F 76 | #define YELLOW 0xFFE0 77 | #define WHITE 0xFFFF 78 | 79 | 80 | TftSpfd5408 tft(LCD_CS, LCD_CD, LCD_WR, LCD_RD, LCD_RESET); 81 | 82 | #define BOXSIZE 40 83 | #define PENRADIUS 3 84 | int oldcolor, currentcolor; 85 | 86 | void setup(void) { 87 | Serial.begin(9600); 88 | Serial.println(F("Paint!")); 89 | 90 | tft.reset(); 91 | 92 | tft.begin(0x9341); 93 | 94 | tft.fillScreen(BLACK); 95 | 96 | tft.fillRect(0, 0, BOXSIZE, BOXSIZE, RED); 97 | tft.fillRect(BOXSIZE, 0, BOXSIZE, BOXSIZE, YELLOW); 98 | tft.fillRect(BOXSIZE*2, 0, BOXSIZE, BOXSIZE, GREEN); 99 | tft.fillRect(BOXSIZE*3, 0, BOXSIZE, BOXSIZE, CYAN); 100 | tft.fillRect(BOXSIZE*4, 0, BOXSIZE, BOXSIZE, BLUE); 101 | tft.fillRect(BOXSIZE*5, 0, BOXSIZE, BOXSIZE, MAGENTA); 102 | // tft.fillRect(BOXSIZE*6, 0, BOXSIZE, BOXSIZE, WHITE); 103 | 104 | tft.drawRect(0, 0, BOXSIZE, BOXSIZE, WHITE); 105 | currentcolor = RED; 106 | 107 | pinMode(13, OUTPUT); 108 | } 109 | 110 | #define MINPRESSURE 10 111 | #define MAXPRESSURE 1000 112 | 113 | void loop() 114 | { 115 | digitalWrite(13, HIGH); 116 | TSPoint p = ts.getPoint(); 117 | digitalWrite(13, LOW); 118 | 119 | // if sharing pins, you'll need to fix the directions of the touchscreen pins 120 | //pinMode(XP, OUTPUT); 121 | pinMode(XM, OUTPUT); 122 | pinMode(YP, OUTPUT); 123 | //pinMode(YM, OUTPUT); 124 | 125 | // we have some minimum pressure we consider 'valid' 126 | // pressure of 0 means no pressing! 127 | 128 | if (p.z > MINPRESSURE && p.z < MAXPRESSURE) { 129 | /* 130 | Serial.print("X = "); Serial.print(p.x); 131 | Serial.print("\tY = "); Serial.print(p.y); 132 | Serial.print("\tPressure = "); Serial.println(p.z); 133 | */ 134 | 135 | if (p.y < (TS_MINY-5)) { 136 | Serial.println("erase"); 137 | // press the bottom of the screen to erase 138 | tft.fillRect(0, BOXSIZE, tft.width(), tft.height()-BOXSIZE, BLACK); 139 | } 140 | // scale from 0->1023 to tft.width 141 | p.x = map(p.x, TS_MINX, TS_MAXX, tft.width(), 0); 142 | p.y = map(p.y, TS_MINY, TS_MAXY, tft.height(), 0); 143 | /* 144 | Serial.print("("); Serial.print(p.x); 145 | Serial.print(", "); Serial.print(p.y); 146 | Serial.println(")"); 147 | */ 148 | if (p.y < BOXSIZE) { 149 | oldcolor = currentcolor; 150 | 151 | if (p.x < BOXSIZE) { 152 | currentcolor = RED; 153 | tft.drawRect(0, 0, BOXSIZE, BOXSIZE, WHITE); 154 | } else if (p.x < BOXSIZE*2) { 155 | currentcolor = YELLOW; 156 | tft.drawRect(BOXSIZE, 0, BOXSIZE, BOXSIZE, WHITE); 157 | } else if (p.x < BOXSIZE*3) { 158 | currentcolor = GREEN; 159 | tft.drawRect(BOXSIZE*2, 0, BOXSIZE, BOXSIZE, WHITE); 160 | } else if (p.x < BOXSIZE*4) { 161 | currentcolor = CYAN; 162 | tft.drawRect(BOXSIZE*3, 0, BOXSIZE, BOXSIZE, WHITE); 163 | } else if (p.x < BOXSIZE*5) { 164 | currentcolor = BLUE; 165 | tft.drawRect(BOXSIZE*4, 0, BOXSIZE, BOXSIZE, WHITE); 166 | } else if (p.x < BOXSIZE*6) { 167 | currentcolor = MAGENTA; 168 | tft.drawRect(BOXSIZE*5, 0, BOXSIZE, BOXSIZE, WHITE); 169 | } 170 | 171 | if (oldcolor != currentcolor) { 172 | if (oldcolor == RED) tft.fillRect(0, 0, BOXSIZE, BOXSIZE, RED); 173 | if (oldcolor == YELLOW) tft.fillRect(BOXSIZE, 0, BOXSIZE, BOXSIZE, YELLOW); 174 | if (oldcolor == GREEN) tft.fillRect(BOXSIZE*2, 0, BOXSIZE, BOXSIZE, GREEN); 175 | if (oldcolor == CYAN) tft.fillRect(BOXSIZE*3, 0, BOXSIZE, BOXSIZE, CYAN); 176 | if (oldcolor == BLUE) tft.fillRect(BOXSIZE*4, 0, BOXSIZE, BOXSIZE, BLUE); 177 | if (oldcolor == MAGENTA) tft.fillRect(BOXSIZE*5, 0, BOXSIZE, BOXSIZE, MAGENTA); 178 | } 179 | } 180 | if (((p.y-PENRADIUS) > BOXSIZE) && ((p.y+PENRADIUS) < tft.height())) { 181 | tft.fillCircle(p.x, p.y, PENRADIUS, currentcolor); 182 | } 183 | } 184 | } 185 | 186 | -------------------------------------------------------------------------------- /libraries/SPFD5408 libraries/SPFD5408/README.md: -------------------------------------------------------------------------------- 1 | # SPFD5408 Library 2 | Author: Joao Lopes 3 | Versions: 4 | 0.9.0 - Beta 1: First public beta - 18/07/15 5 | 0.9.1 - Beta 2: Now works on Mega boards - 19/07/15 6 | 0.9.2 - Beta 3: Now works no Leornardo too - 29/07/15 7 | *** Discontinued, please see below 8 | 9 | This library is the Adafruit TFT Libraries changed to works in TFT 2.4 shields with the SPFD5408 controller. 10 | Tested on Arduino Uno, Leonardo and Mega. See it on action in: https://www.youtube.com/watch?v=Q8WvEjXvAws 11 | 12 | It is based in the last version of Adafruit, inclusive with buttons features. 13 | 14 | The TFT 2.4 is cheap TFT, that generally is from China, 15 | without documentation or libraries for it. 16 | 17 | When we try to use the TFT 2.4 with SPFD5408 controller in sketches with Adafruit TFT libraries, 18 | several things can happen : 19 | 20 | - White Screen 21 | - All screen with noise 22 | - Touch not works or is inverted (coordinate Y) 23 | - The colors are inverted 24 | - And other things 25 | 26 | After trying for several days trying the solutions I found on the web, and none works 100%. 27 | So I decided to do an library specific to this controller. 28 | 29 | I changed the Adafruit libraries for TFT: GFX , TFTLCD and TouchScreen. 30 | I join all in this one library, the library SPFD5408, to avoid problems with duplicate libraries 31 | and enables also have the original library Adafruit ready for use in other projects with another TFT hardware. 32 | 33 | # ATTENTION: DISCONTINUED 34 | 35 | Sorry, this library is discontinued, due now few chinesse TFT is SPFD5402, so few TFT is works with it. 36 | I now use the Nextion Display instead this TFT 37 | 38 | Tip: I am now using Nextion display (https://nextion.itead.cc/), 39 | with many advantages like: 4 wires only for connection with the microcontroller, graphic editor on PC, etc. 40 | 41 | 42 | DISCLAIMER: 43 | 44 | This Library is NOT provided by AdaFruit and they have not 45 | endorsed it. This library is just a lot of modifications in the Adafruit Library, 46 | to works in TFT with SPFD5408 controller (cheap shields) 47 | 48 | ATTENTION: 49 | 50 | Due to variations in Chinese shields with some controller, 51 | there is no guarantee that will work for everyone. 52 | 53 | I test with success in my www.mcufriend.com TFTs, plugged in Uno, Leonardo and Mega Arduino boards. 54 | 55 | THIS LIBRARY IS ONLY FOR SPFD5408 controller. 56 | 57 | If the white screen persists, can indicate than your TFT is not SPFD5408. 58 | Please access this site, to help you identify the controller and library for this TFT: 59 | 60 | http://misc.ws/2015/01/24/lcd-touch-screen-information/ 61 | 62 | INSTALATION: 63 | 64 | To download. click the DOWNLOADS button in the top right corner, rename the uncompressed folder to SPFD5408. 65 | 66 | Place the SPFD5408 library folder your /libraries/ folder. 67 | You may need to create the libraries subfolder if its your first library. 68 | 69 | Or more simple, you access the Arduinos’s IDE menu : sketch/add library 70 | 71 | Restart the IDE 72 | 73 | If you download any code that uses Adafruit Libraries, please verify it: 74 | 75 | —- Pinout XM XP, must be: 76 | 77 | #define YP A1 // must be an analog pin, use "An" notation! 78 | #define XM A2 // must be an analog pin, use "An" notation! 79 | #define YM 7 // can be a digital pin 80 | #define XP 6 // can be a digital pin 81 | 82 | (please verify it, if only a blank screen or noise is showed or touch doesnt works) 83 | 84 | —- readID: comment the original blok: 85 | 86 | // uint16_t identifier = tft.readID(); 87 | // 88 | // if(identifier == 0x9325) { 89 | // Serial.println(F("Found ILI9325 LCD driver")); 90 | // } else if(identifier == 0x9328) { 91 | // Serial.println(F("Found ILI9328 LCD driver")); 92 | // } else if(identifier == 0x7575) { 93 | // Serial.println(F("Found HX8347G LCD driver")); 94 | // } else if(identifier == 0x9341) { 95 | // Serial.println(F("Found ILI9341 LCD driver")); 96 | // } else if(identifier == 0x8357) { 97 | // Serial.println(F("Found HX8357D LCD driver")); 98 | // } else { 99 | // Serial.print(F("Unknown LCD driver chip: ")); 100 | // Serial.println(identifier, HEX); 101 | // Serial.println(F("If using the Adafruit 2.8\" TFT Arduino shield, the line:")); 102 | // Serial.println(F(" #define USE_ADAFRUIT_SHIELD_PINOUT")); 103 | // Serial.println(F("should appear in the library header (Adafruit_TFT.h).")); 104 | // Serial.println(F("If using the breakout board, it should NOT be #defined!")); 105 | // Serial.println(F("Also if using the breakout, double-check that all wiring")); 106 | // Serial.println(F("matches the tutorial.")); 107 | // return; 108 | // } 109 | // 110 | // tft.begin(identifier); 111 | 112 | —- tft.begin: insert after block commented 113 | 114 | tft.begin(0x9341); // SDFP5408 115 | 116 | <<<<<<< HEAD 117 | —- Calibrate before run 118 | ======= 119 | —- tft.rotation: Need for Mega (else screen is showed mirrored) 120 | 121 | tft.setRotation(0); // Need for the Mega, please changed for your choice of rotation initial 122 | 123 | —- Calibrate before run 124 | >>>>>>> origin/master 125 | 126 | Exists one sketch written for my, to help in calibration of touch 127 | See it in examples folder 128 | Run it and change this parameters: 129 | 130 | #define TS_MINX 150 131 | #define TS_MINY 120 132 | #define TS_MAXX 920 133 | #define TS_MAXY 940 134 | 135 | (please verify it if the point of touch is not accurate) 136 | 137 | ———————— 138 | 139 | All changes in Adafruit code is marked with: 140 | 141 | 142 | // ### SPFD5408 change -- Begin 143 | 144 | (change) 145 | 146 | // ### SPFD5408 change -- End 147 | 148 | This is useful if You see the points that be workeds for any touble 149 | 150 | —————— 151 | 152 | Examples: 153 | 154 | adafruit_originals 155 | 156 | From Adafruit Libraries — Not works with the SPFD5408 157 | 158 | 159 | spfd5408_calibrate 160 | 161 | Help the calibration of touch (resistive) 162 | 163 | spfd5408_tftpaint 164 | 165 | example of Adafruit changed to work with the SPFD5408 166 | 167 | spfd5408_graphictest 168 | 169 | example of Adafruit changed to work with the SPFD5408 170 | 171 | spfd5408_rotationtest 172 | 173 | example of Adafruit changed to work with the SPFD5408 174 | 175 | Acknowledgements: 176 | 177 | - First to Adafruit for excellent library 178 | - To Andrologiciels blog (https://andrologiciels.wordpress.com/arduino/lcd/tft-display/) 179 | As the first library could to show the graphics (before only blank or noise screen) 180 | and be the basis for any adjustments that I made in this library 181 | - To Berni_ (https://forum.arduino.cc/index.php?topic=223769.15) 182 | By the logic of TFT calibration for be the basis for my program 183 | --------------------------------------------------------------------------------