Giter Site home page Giter Site logo

masonova1 / tinycircuits-tinyscreen_lib Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tinycircuits/tinycircuits-tinyscreen_lib

0.0 1.0 0.0 770 KB

TinyScreen Arduino Library, Mason's fork

Home Page: https://tinycircuits.com/

License: GNU Lesser General Public License v3.0

C++ 9.42% C 90.58%

tinycircuits-tinyscreen_lib's Introduction

TinyCircuits TinyScreen/TinyScreen+ Arduino Library

This library allows for easy use of the TinyScreen display and input buttons.

This Arduino library is intended for use with TinyCircuits' TinyScreen Arduino Shield and TinyScreen+ Arduino processor to easily interface with the display and buttons. Text, shapes, pixel manipulation, flipping, mirroring, and more allow you to display data, pictures, video, games or whatever you can fit in 96 by 64 pixels with 16 bit color.

Support this library by buying products from TinyCircuits

Basic Example

An example demonstrating and explaining most of the library functions is included. A list of further notes:

  • Include the TinyScreen, SPI, and Wire libraries (Wire can be omitted from TinyScreen+ code if necessary)
  • Declare TinyScreen as display, and use the correct board type(TinyScreenDefault, TinyScreenAlternate, TinyScreenPlus): TinyScreen display = TinyScreen(TinyScreenPlus);
  • TinyScreen library defaults to BGR colors, and this is what the TS_8b and TS_16b color definitions use. This can be changed with setColorMode(TSColorModeRGB);
  • Testing for a button press can now be done in a readable way, and works the same when the display is flipped: if (display.getButtons(TSButtonUpperLeft)) { };
  • TinyScreen+ supports DMA data transfers- check the end of TinyScreen.cpp

Initialization & Control

  • void startData(void)
  • void startCommand(void)
  • void endTransfer(void)
  • void begin(void)
  • void on(void)
  • void off(void)
  • void setFlip(uint8_t)
  • void setMirror(uint8_t)
  • void setBitDepth(uint8_t)
  • void setBrightness(uint8_t)
  • void setColorMode(uint8_t)
  • void writeRemap(void)

Basic Graphic Commands

  • void writePixel(uint16_t)
  • void writeBuffer(const uint8_t *, int)
  • void setX(uint8_t, uint8_t)
  • void setY(uint8_t, uint8_t)
  • void goTo(uint8_t x, uint8_t y)

Built-In Drawing Commands

  • void drawPixel(uint8_t, uint8_t, uint16_t)
  • void drawLine(int16_t, int16_t, int16_t, int16_t, uint8_t, uint8_t, uint8_t)
  • void drawLine(int16_t, int16_t, int16_t, int16_t, uint16_t)
  • void drawRect(int16_t, int16_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t)
  • void drawRect(int16_t, int16_t, uint8_t, uint8_t, uint8_t, uint16_t)
  • void drawHLine(int16_t, int16_t, int16_t, uint8_t, uint8_t, uint8_t)
  • void drawHLine(int16_t, int16_t, int16_t, uint16_t)
  • void drawVLine(int16_t, int16_t, int16_t, uint8_t, uint8_t, uint8_t)
  • void drawVLine(int16_t, int16_t, int16_t, uint16_t)
  • void drawTri(int16_t, int16_t, int16_t, int16_t, int16_t, int16_t, uint8_t, uint8_t, uint8_t, uint8_t)
  • void drawTri(int16_t, int16_t, int16_t, int16_t, int16_t, int16_t, uint8_t, uint16_t)
  • void clearWindow(uint8_t, uint8_t, uint8_t, uint8_t)
  • void clearScreen(void)

I2C / GPIO

  • uint8_t getButtons(uint8_t)
  • uint8_t getButtons(void)
  • void writeGPIO(uint8_t, uint8_t)

Font

  • void setFont(void)
  • uint8_t getFontHeight(void)
  • uint8_t getFontHeight(const FONT_INFO&)
  • uint8_t getPrintWidth(char *)
  • void setCursor(uint8_t, uint8_t)
  • void fontColor(uint16_t, uint16_t)
  • virtual size_t write(uint8_t)

DMA for SAMD

  • void initDMA(void)
  • uint8_t getReadyStatusDMA(void)
  • void writeBufferDMA(uint8_t *,int)

tinycircuits-tinyscreen_lib's People

Contributors

tinycircuits avatar tastewar avatar masonova1 avatar francescom avatar rkoptev avatar cbolgiano avatar

Watchers

James Cloos avatar

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.