Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ATTiny 84 #65

Open
Space-soupXD opened this issue Jul 11, 2024 · 0 comments
Open

ATTiny 84 #65

Space-soupXD opened this issue Jul 11, 2024 · 0 comments

Comments

@Space-soupXD
Copy link

Space-soupXD commented Jul 11, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant