Skip to content

ATTiny 84 #65

Description

@Space-soupXD

How can i modify this for the attiny 84?
Also how can i combine this to be used with a 64x32 oled display?

#include <TinyWireM.h>
#include <Tiny4kOLED.h>

uint8_t width = 64;
uint8_t height = 32;

const int S_CL = 4;
const int S_DA = 6 ;
const int LED = 9;

void setup() {
//setup code here, to run once:
pinMode(S_CL, OUTPUT); // scl
pinMode(LED, OUTPUT);
pinMode(S_DA, OUTPUT); //SDA

digitalWrite(LED, HIGH); // Debug: Indicate wakeup
delay(100);
digitalWrite(LED, LOW);

TinyWireM.begin();
oled.begin(64, 32, sizeof(tiny4koled_init_64x32), tiny4koled_init_64x32);
oled.clear();
oled.setFont(FONT6X8);
oled.on();

digitalWrite(LED, HIGH); // Debug: Indicate wakeup
delay(100);
digitalWrite(LED, LOW);

}
void SOL() {
digitalWrite(LED, HIGH);
delay(50);
digitalWrite(LED, LOW);
delay(50);
}

// add void read
void loop() {
// put main code here, to run repeatedly:
// flash LED
SOL();
delay(50);

oled.clear();
oled.setCursor(0, 0);
oled.setFont(FONT8X16);
oled.println("displayVolt");
oled.setCursor(12, 12);
oled.println("%"); // print
delay(20);

SOL();
oled.clear();

SOL();

SOL();}

This is the current code. I put commands for an LED to flash in setup() so that i know where the microcontroller is at in terms of its boot up. It doesnt make it past the first flash of the led, meaning it doesnt make it through the initialization of i2c and the oled. Thank you

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions