【TB作品】MSP430F5529,单片机,Picture to pixels,乌鸦喝水OLED

功能

Picture to pixels. Use bitmaps to tell a story. Convert pictures to bitmaps and store the bitmaps in a

header file. In the main program, draw the pictures on the OLED screen in sequence to tell a story. Use

the text to help tell the story

乌鸦喝水故事

部分程序

cpp 复制代码
#define u8 unsigned char
#define u16 unsigned int

void SetVcoreUp(unsigned int level);
void initClock(void);

u8 bianliang = 0;

extern unsigned char BMP1[];
extern unsigned char BMP2[];
extern unsigned char BMP3[];
extern unsigned char BMP4[];
extern unsigned char BMP5[];
unsigned char *bmpall[] = { BMP1, BMP2, BMP3, BMP4, BMP5 };

void main(void)
{

    WDTCTL = WDTPW + WDTHOLD; // Stop WDT
    // Set Vcore to accomodate for max. allowed system speed#include "HAL_PMM.h"
    initClock();
    OLED_Init();

    P1DIR &= ~BIT1;
    P1REN |= BIT1;
    P1OUT |= BIT1;

    OLED_DrawBMP(bmpall[bianliang]);

    while (1)
    {
        if ((P1IN & BIT1) == 0)
        {
            delay_ms(5);
            if ((P1IN & BIT1) == 0)
            {
                while ((P1IN & BIT1) == 0)
                    ;

                bianliang = (bianliang + 1) % 5;
                OLED_DrawBMP(bmpall[bianliang]);

            }
        }
    }

}

全部程序

cpp 复制代码
https://docs.qq.com/sheet/DUEdqZ2lmbmR6UVdU?tab=BB08J2
相关推荐
佳木逢钺1 分钟前
从零开始:基于STM32H750的硬件设计与软件开发完整流程详解
stm32·单片机·嵌入式硬件
Deitymoon2 小时前
ESP8266——透传
单片机·网络协议·tcp/ip
zhangrelay2 小时前
云课实践速通系列-基础篇汇总-必修-通识基础和专业基础-2026--工科--自动化、电气、机器人、测控等
linux·笔记·单片机·学习·ubuntu·机器人·自动化
Deitymoon3 小时前
ESP8266——UDP传输
单片机·网络协议·udp
踏着七彩祥云的小丑4 小时前
嵌入式——认识电子元器件——光电器件系列
单片机·嵌入式硬件
羽获飞4 小时前
从零开始学嵌入式之STM32——31.高级定时器
stm32·单片机·嵌入式硬件
iCxhust6 小时前
一块电路板的自觉
单片机·嵌入式硬件·嵌入式·微机原理
学习者1234567896 小时前
Bootloader跳转APP代码流程
单片机·嵌入式硬件
ACP广源盛139246256736 小时前
一芯搞定多屏高清@ACP#GSV1221 DP 1.4 MST 转 HDMI 1.4 高集成转换芯片
网络·人工智能·嵌入式硬件·计算机外设·电脑
iCxhust7 小时前
在 emu8086 中可以直接编译运行的完整汇编程序,演示数组的定义、遍历、求和、求最大值。
开发语言·前端·javascript·汇编·单片机·嵌入式硬件·算法