Giter VIP home page Giter VIP logo

boatgaugesalt's Introduction

BoatGaugesAlt

The alternative example sketch for six different boat gauges came about due to an issue with original code.

image

Which I also came across and reported it under original project here.

The solution boils down to removing reliance on the needle bounding box coordinates which are pre-populate in the setup() method:

  while (a != 44) {
    x[i] = r * cos(rad * a) + sx;
    y[i] = r * sin(rad * a) + sy;
    x2[i] = (r - 20) * cos(rad * a) + sx;
    y2[i] = (r - 20) * sin(rad * a) + sy;

    i++;
    a++;

    // reset "a" on overflow
    if (a == 360) {
      a = 0;
  }

Code repositories

Arduino IDE Setup

  1. Install ESP32 boards library guide from randomnerdtutorials
  2. Install TFT_eSPI library by Bodmer through Library Manager (Sketch > Include Library > Manage Libraries or Ctrl+Shift+l)

image

Configure TFT_eSPI library

Open ..\Documents\Arduino\libraries\TFT_eSPI\User_Setup.h and comment out line 44:

//#define ILI9341_DRIVER

On line 64 uncomment GC9A01 driver:

#define GC9A01_DRIVER

Open ..\Documents\Arduino\libraries\TFT_eSPI\User_Setup_Select.h and comment out line 24:

//#include <User_Setups/Setup1_ILI9341.h>

On line 105 uncomment GC9A01 setup:

#include <User_Setups/Setup200_GC9A01.h>

Open ..\Documents\Arduino\libraries\TFT_eSPI\User_Setups\Setup200_GC9A01.h and update pin assignments:

#define TFT_MISO 5
#define TFT_MOSI 2
#define TFT_SCLK 15  // Clock pin
#define TFT_CS   17  // Chip select control pin
#define TFT_DC   16  // Data Command control pin
#define TFT_RST  4   // Reset pin (could connect to Arduino RESET pin)

ESP32 & GC9A01 Connections

image

Image is courtesy of WOKWI.com and some MS Paint work

ESP32     GC9A01
3V3       VCC
GND       GND
D15       SCL
D2        SDA
D4        RES
RX2       DC
TX2       CS
D5        BLK

boatgaugesalt's People

Contributors

iiminov avatar

Watchers

 avatar

boatgaugesalt's Issues

screen all orange

Hello sir, I have also encountered the same problem. After running your code, my screen is still all orange. How do you modify it?It seems that the statement still didn't work.TFT_eSprite img = TFT_eSprite(&tft)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.