【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
相关推荐
Python小老六2 小时前
冯诺依曼架构 vs 哈佛架构 对比
stm32·单片机·嵌入式硬件·架构
TEC_INO2 小时前
Hal库的使用
单片机·hal库
羽获飞3 小时前
从零开始学嵌入式之STM32——13.使用STM32自带硬件模块实现IIC协议通讯
单片机·嵌入式硬件
单片机设计星球3 小时前
51单片机的【智能婴儿床】仿真设计
单片机·嵌入式硬件·51单片机
weiyvyy3 小时前
机器人嵌入式开发者的成长路径-技能体系构建
人工智能·嵌入式硬件·机器人
San_a dreamer fish5 小时前
STM32开发入门基础篇知识要点
stm32·单片机·嵌入式硬件
安庆平.Я6 小时前
STM32——FreeRTOS - 移植
stm32·单片机·嵌入式硬件
HIZYUAN7 小时前
AG32 MCU可以替代STM32+CPLD吗(一)
stm32·单片机·嵌入式硬件
Lester_11017 小时前
STM32 定时器驱动电机时,定时器编码器输入通道引脚模式为什么设置为输出开漏,不应该是输入模式吗
stm32·单片机·嵌入式硬件
逐步前行7 小时前
STM32_GPIO_HAL库操作
stm32·单片机·嵌入式硬件