Skip to content

newdigate/teensy-st7735-linux-stubs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ubuntu-x64 ubuntu-opengl basic-example scrolltest-example spitftbitmap-example

teensy st7735 linux stubs

experimental library for developing visual components for st7735 display...

structure

  • src: abstract st7735_t3 class for linux.
  • extras/opengl: implementation of st7735_t3 using opengl framebuffer

examples

installation

st7735_t3 class

> mkdir cmake-build-debug && cd cmake-build-debug && cmake -DCMAKE_BUILD_TYPE=Debug && sudo make install

opengl st7735 emulator

> cd extras/opengl && mkdir cmake-build-debug && cd cmake-build-debug && cmake -DCMAKE_BUILD_TYPE=Debug && sudo make install

usage

st7735_t3

  • once installed, add to your CMakeLists.txt
find_package(teensy_st7735_linux_stubs)
include_directories(${teensy_st7735_linux_stubs_INCLUDE_DIR})
...
target_link_libraries(your_application ${teensy_st7735_linux_stubs_LIBS})
  • include ST7735.h in your c++ code:
#include "ST7735_t3.h"

opengl st7735_t3

  • once installed, add to your CMakeLists.txt
find_package(teensy_st7735_linux_opengl)
include_directories(${teensy_st7735_linux_extras_opengl_INCLUDE_DIR})
...
target_link_libraries(your_application ${teensy_st7735_linux_extras_opengl_LIBS})
  • include st7735_opengl.h in your c++ code:
#include "Arduino.h"          // from teensy-x86-stubs
#include "st7735_opengl.h"

st7735_opengl_noinput tft = st7735_opengl_noinput();

void testlines(uint16_t color) {
    tft.fillScreen(ST7735_BLACK);
    for (int16_t x=0; x < tft.width(); x+=6) {
        tft.drawLine(0, 0, x, tft.height()-1, color);
        delay(200);
    }
}

int main() {
    initialize_mock_arduino();
    testlines(ST7735_RED);
    
    // keep window open until user closes 
    while(!tft.shouldClose()) {
        tft.loop();
    }
}

dependencies

> sudo apt-get install -yq libglfw3 libglfw3-dev libglu1-mesa-dev freeglut3-dev mesa-common-dev libx11-dev libxmu-dev libxi-dev libgl-dev libglew-dev
  • MacOS specific
    • glfw, glew
> brew install glfw
> brew install glew

About

crude emulation of st7735_t3 library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages