【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
相关推荐
XiHongShi20162 小时前
STM32F407 CRC-循环冗余校验例程,建议保存学习
stm32·单片机
lhbweilai3 小时前
结合手册调试各个功能的寄存器+最后通过寄存器编写SPI的初始化和读写函数
stm32·单片机
小程序设计6 小时前
本科毕设避坑|大数据 / 单片机物联网 / 网络工程 / PLC / 机械设计选题与落地心得
java·hive·hadoop·单片机
Zwawa11 小时前
把按键和 LED 状态显示出来:第一次看见程序到底在干什么
单片机·嵌入式
小程序设计11 小时前
基于STM32的办公室智能空气净化系统设计
stm32·单片机
不悔哥6 天前
开源OV-Watch:怎么做一个智能手表
单片机·开源·嵌入式
XiHongShi20166 天前
STM32F407 RTC定时器例程,建议保存
stm32·单片机·学习
深圳老胡6 天前
STM32F407 控制 L6470 步进电机驱动 —— 控制过程简介
笔记·stm32·单片机·嵌入式硬件·代码规范
女神下凡6 天前
嵌入式设计的各种存储芯片的硬件/软件设计规范,非常全面。
arm开发·单片机·嵌入式硬件
梅梅9666 天前
一款mipi转lvds的lcd调试(LT8912B)
单片机·计算机外设·电脑·显示器·pd芯片