【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
相关推荐
曙曙学编程2 小时前
stm32——GPIO
c语言·c++·stm32·单片机·嵌入式硬件
第二层皮-合肥3 小时前
FPGA实现ETH接口
单片机·嵌入式硬件·fpga开发
anghost1504 小时前
基于单片机的智能声控窗帘
单片机·嵌入式硬件·mongodb
璞致电子6 小时前
【PZ-ZU47DR-KFB】璞致FPGA ZYNQ UltraScalePlus RFSOC QSPI Flash 固化常见问题说明
嵌入式硬件·fpga开发·fpga·软件无线电·sdr
陌夏微秋7 小时前
FPGA硬件设计2 最小芯片系统-ZYNQ7020/7010
嵌入式硬件·fpga开发·硬件架构·硬件工程·信息与通信·智能硬件
猫猫的小茶馆7 小时前
【STM32】HAL库中的实现(五):ADC (模数转换)
stm32·单片机·嵌入式硬件·mcu·51单片机·智能硬件·pcb工艺
紫阡星影9 小时前
【模块系列】STM32&W25Q64
stm32·单片机·嵌入式硬件
keer_zu10 小时前
STM32L051同时处理Alarm A和Alarm B中断
stm32·单片机·嵌入式硬件
酷飞飞11 小时前
STC8单片机驱动I2C屏幕:实现时间、日期与温湿度显示
单片机·嵌入式硬件·51单片机·嵌入式
源远流长jerry14 小时前
STM32之MCU和GPIO
linux·c++·stm32·单片机·嵌入式硬件