【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
相关推荐
独处东汉17 分钟前
AI辅助Stm32l031项目开发调试板子之按键跟adc
stm32·单片机·嵌入式硬件
爱潜水的小L1 小时前
自学嵌入式day48,温度传感器
单片机·嵌入式硬件
电子绿洲1 小时前
什么是红外接收头?红外遥控系统核心元件基础知识解析
单片机·嵌入式硬件·智能硬件·硬件电路·硬件设计
乡野码圣1 小时前
【RK3588 Android12】开发效率提升技巧
android·嵌入式硬件
蓁蓁啊2 小时前
GCC 头文件搜索路径:-I vs -idirafter 深度解析
java·前端·javascript·嵌入式硬件·物联网
Xx香菜3 小时前
单片机—4
单片机·嵌入式硬件
VekiSon3 小时前
51单片机——GPIO、按键、中断、定时器与PWM
单片机·嵌入式硬件·51单片机
纳祥科技4 小时前
NX3302,3进1出HDMI/DVI视频切换器芯片,兼容LT8631UX
单片机·嵌入式硬件·音视频
析木不会编程4 小时前
51单片机程序下载逻辑
单片机·嵌入式硬件·51单片机
羊小猪~~4 小时前
【QT】-- QT基础类
开发语言·c++·后端·stm32·单片机·qt