目录

【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
本文是转载文章,点击查看原文
如有侵权,请联系 xyy@jishuzhan.net 删除
相关推荐
BW.SU2 小时前
单片机 + 图像处理芯片 + TFT彩屏 触摸开关控件 v1.2
单片机·人机交互·ra8889·开关控件·触摸屏设计
双叶8362 小时前
(51单片机)点阵屏LED显示图片(点阵屏LED教程)(74Hc595教程)
c语言·开发语言·单片机·嵌入式硬件·51单片机
深圳市青牛科技实业有限公司2 小时前
D3502C:一款高性能降压转换器的技术解析,可替代U3502C采用ESOP8封装
单片机·嵌入式硬件·快充·扫地机器人吸尘·筋膜枪电机·驱动轮电机
顾念`3 小时前
履带小车+六轴机械臂(2)
单片机·嵌入式硬件
努力创造奇迹3 小时前
STM32 HAL库 ADC+TIM+DMA 3路 1S采样一次电压
stm32·单片机·嵌入式硬件
leoFY1234 小时前
STM32 BOOT设置,bootloader,死锁使用方法
stm32·单片机·嵌入式硬件
czhaii4 小时前
单片机任意普通IO引脚使用定时器扩展外部中断的巧妙方法
单片机·嵌入式硬件
二块烧肉6 小时前
STM32 认识STM32
stm32·单片机·嵌入式硬件
Born_t0ward7 小时前
基于STM32 的实时FFT处理(Matlab+MDK5)
stm32·嵌入式硬件·matlab·mdk5·快速fft
程序猿阿伟8 小时前
《鸿蒙软总线:基于UDP的数据传输奥秘与优势》
单片机·udp·harmonyos