You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
101 lines
1.7 KiB
101 lines
1.7 KiB
#include <stdio.h>
|
|
#include "pico/stdlib.h"
|
|
#include "hardware/gpio.h"
|
|
#include "pico/binary_info.h"
|
|
|
|
#include "hardware/spi.h"
|
|
|
|
#include "framebuffer.h"
|
|
#include "fb_text.h"
|
|
#include "oled.h"
|
|
|
|
#define SSD1309_HEIGHT 64
|
|
|
|
const uint LED_PIN = 25;
|
|
|
|
/* Picotool info */
|
|
bi_decl(bi_program_description("OLED demo"))
|
|
bi_decl(bi_1pin_with_name(LED_PIN, "Blink LED"))
|
|
|
|
static const uint8_t zir_data[] = {
|
|
// levo
|
|
0b10000000,
|
|
0b01000000,
|
|
0b00100000,
|
|
0b00010000,
|
|
0b00001000,
|
|
0b00000100,
|
|
0b00000010,
|
|
0b00011001,
|
|
0b00011111,
|
|
0b11111000,
|
|
0b00011111,
|
|
0b00001000,
|
|
//
|
|
0b10000000,
|
|
0b01000000,
|
|
0b00100000,
|
|
0b00010000,
|
|
0b00001000,
|
|
0b00000100,
|
|
0b00000010,
|
|
0b00000001,
|
|
0b10000000,
|
|
0b11111111,
|
|
0b00100000,
|
|
0b00010000,
|
|
//
|
|
0b00110000,
|
|
0b10001000,
|
|
0b11111000,
|
|
0b00011000,
|
|
0b11111000,
|
|
0b10011000,
|
|
0b00011000,
|
|
0b10011000,
|
|
0b11111000,
|
|
0b00011111,
|
|
0b11111000,
|
|
0b10000000,
|
|
};
|
|
|
|
static const fb_bitmap_t zir = {
|
|
.width = 12,
|
|
.height = 24,
|
|
.data = zir_data
|
|
};
|
|
|
|
int main() {
|
|
stdio_init_all();
|
|
|
|
gpio_init(LED_PIN);
|
|
gpio_set_dir(LED_PIN, GPIO_OUT);
|
|
|
|
oled_init();
|
|
|
|
fb_clear();
|
|
|
|
fb_bitmap(5, 5, &zir);
|
|
fb_bitmap(20, 5, &zir);
|
|
|
|
fb_text(40, 35, "MEOW", FONT_DOUBLE, 1);
|
|
fb_text(50, 20, "meow", FONT_DOUBLE, 1);
|
|
|
|
fb_frame(0, 0, 128, 64, 2, 1);
|
|
|
|
fb_blit();
|
|
|
|
while (1) {
|
|
oled_invert(true);
|
|
|
|
gpio_put(LED_PIN, 0);
|
|
sleep_ms(1000);
|
|
|
|
oled_invert(false);
|
|
|
|
gpio_put(LED_PIN, 1);
|
|
|
|
//puts("Hello World\n");
|
|
sleep_ms(1000);
|
|
}
|
|
}
|
|
|