【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
相关推荐
某林2123 小时前
基于SLAM Toolbox的移动机器人激光建图算法原理与工程实现
stm32·嵌入式硬件·算法·slam
DTI07013 小时前
xilinx的vivado工具综合一直转圈圈,卡死后如何解决?
嵌入式硬件·fpga开发
点灯小铭5 小时前
基于单片机的去皮计价与超重报警电子秤设计与实现
单片机·嵌入式硬件·毕业设计·课程设计·期末大作业
章鱼哥嵌入式开发7 小时前
【 STM32 ADC电压采集与串口显示系统】
stm32·单片机·课程设计·嵌入式学习·实验室测量
HappyShengxiang9 小时前
TI发布全新Cortex-M33的MCU产品MSPM33C321A
单片机·嵌入式硬件·mcu·电赛
✧˖‹gσσ∂ иιghт›✧9 小时前
stm32 cube max+keil5的环境怎么printf重定向
stm32·单片机·嵌入式硬件
芋头莎莎10 小时前
keil 4 51单片机的安装教程
单片机·嵌入式硬件·51单片机
xingzhemengyou111 小时前
STM32 时钟树
stm32·单片机
无聊到发博客的菜鸟11 小时前
STM32 手册寄存器属性
stm32·单片机·嵌入式·rtos·寄存器
tengtext11 小时前
单片机mcu(stm32)计算生成二维码
stm32·单片机·嵌入式硬件