# Fur Elise on ATtiny85
Plays the opening of Beethoven's Fur Elise on a piezo buzzer while showing note names on a 128x64 SSD1306 OLED.
Built with [ssd1306xled](https://github.com/tejashwikalptaru/ssd1306xled), a lightweight OLED driver for the ATtiny85. The whole thing fits in 2.5 KB of flash and 46 bytes of RAM.
## What happens on screen
- Current note name in the center (E5, D#5, B4, etc.)
- A horizontal bar that stretches wider for higher notes
- The last 10 notes scrolling along the bottom
Sound comes from toggling PB4 at the target frequency. The melody is stored in program memory as note-duration pairs so it costs zero RAM.
## Hardware
| Pin | Connection |
|-----|-----------|
| PB0 (pin 5) | SSD1306 SDA |
| PB2 (pin 7) | SSD1306 SCL |
| PB4 (pin 3) | Piezo buzzer positive |
| GND | SSD1306 GND + buzzer GND |
| VCC | SSD1306 VCC |
## About the library
ssd1306xled is a flash-optimized driver for SSD1306, SSD1315, and SSH1106 OLEDs. It bit-bangs I2C through the ATtiny85's USI peripheral instead of using the Wire library, saving about 1 KB of flash.
The library includes pixel-level bitmap positioning, signed-X clipping for off-screen sprites, and page compositing for flicker-free overlapping sprites. These were added in v1.0.0 after a user building a Space Invaders game ran into page-boundary flicker.
- Source: https://github.com/tejashwikalptaru/ssd1306xled
- Docs: https://tejashwikalptaru.github.io/ssd1306xled/
- More examples: https://github.com/tejashwikalptaru/ssd1306xled/tree/master/examples