Files
-
/
-
addon board / C64Saver2-addon.kicad_pcb
-
addon board / C64Saver2-addon.sch
-
addon board / rescue-backup / C64Saver2-addon-2019-05-19-18-52-40.sch
-
C64 Saver 2 / C64Saver2.kicad_pcb
-
C64 Saver 2 / C64Saver2.sch
-
old-saver / 1.0 / c64saver.brd
-
old-saver / 1.0 / c64saver.sch
-
old-saver / 1.1-1.3 / c64saver_1.1.brd
-
old-saver / 1.1-1.3 / c64saver_1.1.sch
-
old-saver / 1.1-1.3 / c64saver_1.2.brd
-
old-saver / 1.1-1.3 / c64saver_1.3.brd
-
old-saver / 1.1-1.3 / c64saver_1.3.sch
Last update 5 years 8 months
by
bwack
Filesaddon boardsrclibstinusaur-ssd1306xledssd1306xled_imgs1 | |
---|---|
.. | |
Makefile | |
README.txt | |
img0s128x64c1.h | |
img1s128x64c1.h | |
main.c |
main.c/** * SSD1306xLED - Library/Driver for the SSD1306 based OLED/PLED 128x64 displays * * @author Neven Boyanov * * This is part of the Tinusaur/SSD1306xLED project. * * Copyright (c) 2018 Neven Boyanov, The Tinusaur Team. All Rights Reserved. * Distributed as open source software under MIT License, see LICENSE.txt file. * Retain in your source code the link http://tinusaur.org to the Tinusaur project. * * Source code available at: https://bitbucket.org/tinusaur/ssd1306xled * */ // ============================================================================ // NOTE: About F_CPU - it should be set in either (1) Makefile; or (2) in the IDE. #include <stdint.h> #include <avr/io.h> #include <util/delay.h> #include "tinyavrlib/cpufreq.h" #include "ssd1306xled/ssd1306xled.h" #include "img0s128x64c1.h" #include "img1s128x64c1.h" // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ATtiny85 // +----------+ (-)--GND-- // (RST)---+ PB5 Vcc +---(+)--VCC-- // ---[OWOWOD]---+ PB3 PB2 +---[TWI/SCL]- // --------------+ PB4 PB1 +------------- // --------(-)---+ GND PB0 +---[TWI/SDA]- // +----------+ // Tinusaur Board // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ---------------------------------------------------------------------------- // -----(+)---------------> // Vcc, Pin 1 on SSD1306 Board // -----(-)---------------> // GND, Pin 2 on SSD1306 Board #define SSD1306_SCL PB2 // SCL, Pin 3 on SSD1306 Board #define SSD1306_SDA PB0 // SDA, Pin 4 on SSD1306 Board #define SSD1306_SA 0x78 // Slave address // ---------------------------------------------------------------------------- int main(void) { // ---- Initialization ---- // ---- CPU Frequency Setup ---- #if F_CPU == 1000000UL #pragma message "F_CPU=1MHZ" CLKPR_SET(CLKPR_1MHZ); #elif F_CPU == 8000000UL #pragma message "F_CPU=8MHZ" CLKPR_SET(CLKPR_8MHZ); #else #pragma message "F_CPU=????" #error "CPU frequency should be either 1 MHz or 8 MHz" #endif #define STEPS_DELAY_SHORT 200 #define STEPS_DELAY 600 #define STEPS_DELAY_LONG 2000 // Small delay is necessary if ssd1306_init is the first operation in the application. _delay_ms(40); ssd1306_init(); // ---- Main Loop ---- for (;;) { ssd1306_clear(); _delay_ms(STEPS_DELAY_SHORT); // ---- Draw bitmap on the screen ---- ssd1306_draw_bmp(0,0,128,8, img0s128x64c1); _delay_ms(STEPS_DELAY_LONG); _delay_ms(STEPS_DELAY_LONG); // ---- Draw bitmap on the screen ---- ssd1306_draw_bmp(0,0,128,8, img1s128x64c1); _delay_ms(STEPS_DELAY_LONG); _delay_ms(STEPS_DELAY_LONG); _delay_ms(STEPS_DELAY_LONG); _delay_ms(STEPS_DELAY_LONG); } return 0; // Return the mandatory for the "main" function int value. It is "0" for success. } // ============================================================================