打印
[PIC®/AVR®/dsPIC®产品]

MCC做I2C硬件太难了,一直没动静,还好我会IO模拟的

[复制链接]
411|3
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
zhuomuniao110|  楼主 | 2023-10-21 15:48 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
i2c.X.rar (625.15 KB)
#include "mcc_generated_files/system/system.h"
#include "oled/oled.h"
#include "oled/oledpic.h"
/*
    Main application
*/

int main(void)
{
    float numberfu=12.5;
    SYSTEM_Initialize();

    // If using interrupts in PIC18 High/Low Priority Mode you need to enable the Global High and Low Interrupts
    // If using interrupts in PIC Mid-Range Compatibility Mode you need to enable the Global Interrupts
    // Use the following macros to:

    // Enable the Global Interrupts
    INTERRUPT_GlobalInterruptEnable();

    // Disable the Global Interrupts
    //INTERRUPT_GlobalInterruptDisable();
    OLED_Init();
    OLED_Allfill();
    OLED_Clear();
    OLED_ShowPic(90,0,122,4,BMP1);
    OLED_ShowHzbig(0,0,0);
        OLED_ShowStr(33,0,"Hello",16);
        HAL_Delay(1000);
        OLED_Clear();

        OLED_ShowFloat(50,0,numberfu,3,16);
        OLED_ShowHanzi(50,2,0);
        OLED_ShowHanzi(34,2,1);
            for(uint32_t number=500;number<600;number++)
        {
                OLED_ShowNum(80,2,number,4,16);
                HAL_Delay(10);
        }
        OLED_ShowChar(4,0,'H',16);
        OLED_ShowChar(4,2,'M',16);
        HAL_Delay(2100);
    while(1)
    {
    }   
}


使用特权

评论回复
沙发
598330983| | 2023-10-21 19:54 | 只看该作者
https://bbs.21ic.com/icview-3334816-1-1.html
参靠你的文件,修改了下,好了。

使用特权

评论回复
板凳
dongnanxibei| | 2023-10-23 17:28 | 只看该作者
IO模拟的没硬件的省心啊。

使用特权

评论回复
地板
dongnanxibei| | 2023-10-23 17:28 | 只看该作者
不过IO模拟的更加通用。

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

189

主题

3256

帖子

10

粉丝