【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
相关推荐
2501_922639584 小时前
率能半导体 SS6285L直流双向马达驱动芯片:18V/5A,覆盖电子锁、按摩仪、电动玩具、机器人四大应用场景
单片机·嵌入式硬件·硬件工程
专一的咸鱼哥4 小时前
预训练 ONNX 模型转换为 .eim
嵌入式硬件·机器人
SuperByteMaster4 小时前
三极管 做开关电路 要尽快跳过放大区
嵌入式硬件
铅笔小新z5 小时前
【stm32】输入捕获-超声波测距
stm32·单片机·嵌入式硬件
菩提树下的凡夫5 小时前
机器视觉LED光源控制器
单片机·嵌入式硬件
铅笔小新z5 小时前
【stm32】全彩led灯(PWM)
stm32·单片机·嵌入式硬件
小鸡脚来咯5 小时前
【无标题】
单片机·嵌入式硬件
澄纸气5 小时前
STM32 外部中断实战:对射式计数器和编码器计数器,两个实验跑通 EXTI
stm32·单片机·嵌入式硬件
2501_922639586 小时前
率能半导体 SS6286L直流双向马达驱动芯片:18V/7A,覆盖电子锁、玩具、无线充电、机器人四大应用场景
stm32·单片机·嵌入式硬件·硬件工程
搁浅小泽7 小时前
IGBT 与散热片间未加绝缘垫片导致桥臂直通原理分析
单片机·嵌入式硬件·设计规范