Hi I'm using an attiny85 as standalone. The bootloader is burned on it successfully and yes I know the pins arent set up for attiny85 because the numbers are too high but I've already tried changing them to the correct pins. The issue is, I keep getting a a red highlight over: Serial.begin(9600);
Everything else works fine I know because it has already been successfully uploaded to a atmega328p standalone and tested.
I'm kind of a beginner in coding.
how do I stop Serial.begin(9600); from being highlighted. What would I need to change to fix this
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <gfxfont.h>
#include <Adafruit_SSD1306.h>
#define OLED_RESET 12
const byte buttonpin = 3;
const byte pinny = 2;
Adafruit_SSD1306 display(OLED_RESET);
static const unsigned char PROGMEM Logo[] = //128x64 bitmap
{ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFE, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0x1F, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xF9, 0x8F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x39, 0xCF, 0xE7, 0xFF, 0xFF,
0xFF, 0xFF, 0xF0, 0x01, 0xCF, 0xE7, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0x0F, 0x87, 0xFF, 0xFF,
0xFF, 0xFF, 0xFC, 0x20, 0x04, 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x7F, 0xFF, 0xFF,
0xFF, 0xFF, 0xFC, 0xC0, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0xE0, 0x07, 0x0F, 0xFF, 0xFF,
0xFF, 0xFF, 0xF3, 0x00, 0x80, 0x67, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x09, 0xC8, 0x07, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xF9, 0x8F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0x9F, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFC, 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
};
void setup()
{
pinMode(13, OUTPUT);
pinMode(pinny, INPUT_PULLUP);
// initialize with the I2C addr 0x3C / mit I2C-Adresse 0x3c initialisieren
display.begin(SSD1306_SWITCHCAPVCC, 0x3c);
pinMode(buttonpin, INPUT_PULLUP);
// initialize with the I2C addr 0x3C / mit I2C-Adresse 0x3c initialisieren
display.begin(SSD1306_SWITCHCAPVCC, 0x3c);
Serial.begin(9600);// <-------------THIS IS WHATS HIGHLIGHTED RED> HOW TO FIX?
display.begin(SSD1306_SWITCHCAPVCC, 0x3C); // initialize with the I2C addr 0x3D (for the 128x64)
// init done
display.clearDisplay();
display.display(); // show splashscreen
delay(2000);
display.clearDisplay(); // clears the screen and buffer
display.setTextColor(INVERSE);
display.drawBitmap(31, 8, Logo, 64, 32, 1);
display.display();
delay(6000);
display.clearDisplay();
display.drawBitmap(0, 0, Logo, 0, 0, 0);
display.display();
delay(1000);
display.clearDisplay();
}
void loop()
{
if (digitalRead(buttonpin) == LOW)
{
display.clearDisplay();
display.setCursor(41,20);
display.setTextSize(1);
display.print("");
display.setCursor(32,20);
display.setTextSize(0);
display.print("Goodbye");
}
else
{
display.clearDisplay();
}
display.display();
{
if (digitalRead(pinny) == LOW)
{
display.clearDisplay();
display.setCursor(41,20);
display.setTextSize(1);
display.print("");
display.setCursor(32,20);
display.setTextSize(0);
display.print("Hello");
}
else
{
display.clearDisplay();
}
display.display();
}
}