【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
相关推荐
百里东风15 分钟前
STM32外设AD-定时器触发 + DMA读取模板
stm32·单片机·嵌入式硬件
Deacde_ZY1 小时前
【控制波形如何COPY并无痛使用】
单片机·嵌入式硬件
仰泳之鹅3 小时前
【51单片机中断】
单片机·嵌入式硬件·51单片机
happygrilclh3 小时前
STM32 定时器主从模式配置解析
stm32·单片机·嵌入式硬件
王光环5 小时前
STM32H743IIT6_ADC采集误差分析与ADC_DMA
stm32·单片机
芯眼5 小时前
STM32启动文件详解(重点)
java·开发语言·c++·stm32·单片机·mybatis
长流小哥6 小时前
STM32 ADC+DMA+TIM触发采样实战:避坑指南与源码解析
stm32·单片机·嵌入式硬件·keil5
道亦无名6 小时前
STM32控制电机
stm32·单片机·嵌入式硬件
happygrilclh7 小时前
STM32的ADC模块中,**采样时机(Sampling Time)**和**转换时机(Conversion Time),获取数据的时机详解
stm32·单片机·嵌入式硬件
真的想上岸啊7 小时前
学习51单片机02
嵌入式硬件·学习·51单片机