oLed display sample.
 DuinoKit Tiny (NEW - Please Contribute)   Started by Daniel Alich   2018-02-19 19:20:47 -05:00   Comments: 2    Viewed: 3044

  1. Daniel Alich
    Daniel Alich Member Staff Member
    // Script and wiring found here....
    // https://ebtenorio.wordpress.com/2017/08/03/oled-i2c-with-attiny85/
    ATTiny P2-> oLed SCL
    ATTiny P0-> oLed SDA
    ATTiny GND-> oLed GND
    ATTiny 5V-> oLed VCC
    #include "SSD1306_minimal.h"
    #include <avr/pgmspace.h>

    #include <TinyWireM.h>
    #include <USI_TWI_Master.h>
    #define DEG "xa7" "C"

    #define DEG "xa7" "C"

    SSD1306_Mini oled; // Declare the OLED object

    void splash() {
    oled.clear(); // Clears the display

    oled.cursorTo(0, 0); // x:0, y:0
    oled.printString(" DuinoKit Fun");

    oled.cursorTo(0, 10); // x:0, y:23
    oled.printString("With the ATTiny85!");

    //oled.cursorTo(0, 20); // x:0, y:46
    //oled.printString(" DuinoKit Tiny!");

    oled.cursorTo(0, 21); // x:0, y:69
    oled.printString(" Coming Soon");

    oled.cursorTo(0,31 ); // x:0, y:69
    oled.printString("with YOUR support!");

    void setup() {
    oled.init(0x3C); // Initializes the display to the specified address
    oled.clear(); // Clears the display
    delay(1000); // Delay for 1 second
    splash(); // Write something to the display (refer to the splash() method

    void loop() {
    Daniel Alich, 2018-02-19 19:20:47 -05:00
  2. Daniel Alich
    Daniel Alich Member Staff Member
    Not 100% dure why, but it seems I have some driver isses with the previous code.  Had to add in the following lines and it then compiled and run fine.

    #include <TinyWireM.h>
    #include <USI_TWI_Master.h>
    #define DEG "xa7" "C"

    This has been added to the code above
    Daniel Alich, 2018-10-30 11:07:09 -04:00
  3. (You must log in or sign up to post here)

Report Post

Write your reason

Log in | Sign up
Terms & Conditions!