开发平台:MDK

下载器:板载jlink

开发板:FPB-RA4E1

目地:使用开发板点亮OLED,并从左向右移动。

下面开始

1、连接原理图:

image.png

image.png

2、位号图

image.png

3、Fsp配置

image.png

4.相关代码:

  1. 显示主代码:
  2. fsp_err_t err;
  3.     /* TODO: add your own code here */

  4.         OLED_Init();
  5.         OLED_ShowStr(0, 0,(uint8_t *) "RA4e1", 2);
  6.         OLED_HorizontalShift(2000);
  7.         OLED_ShowStr(0, 15,(uint8_t *) "RA4e1", 2);

  8.         err = R_RTC_Open(&g_rtc0_ctrl, &g_rtc0_cfg);
  9.     /* Handle any errors. This function should be defined by the user. */
  10.         assert(FSP_SUCCESS == err);
  11.         /* R_RTC_CalendarTimeSet must be called at least once to start the RTC */
  12.         R_RTC_CalendarTimeSet(&g_rtc0_ctrl, &set_time);
  13.         /* Set the periodic interrupt rate to 1 second */
  14.         R_RTC_PeriodicIrqRateSet(&g_rtc0_ctrl, RTC_PERIODIC_IRQ_SELECT_1_SECOND);
  15.         OLED_RefreshRAM();




  16. 填充:
  17. <span style="white-space: normal;"><span style="white-space:pre">        </span>for(uint16_t m = 0; m < displayHeight/8; m++)</span>
  18. <span style="white-space: normal;"><span style="white-space:pre">        </span>{</span>
  19. <span style="white-space: normal;"><span style="white-space:pre">                </span>for(uint16_t n = 0; n < displayWidth; n++)</span>
  20. <span style="white-space: normal;"><span style="white-space:pre">                </span>{</span>
  21. <span style="white-space: normal;"><span style="white-space:pre">                                </span>WriteDat(OLED_RAM[m][n]);</span>
  22. <span style="white-space: normal;"><span style="white-space:pre">                </span>}</span>
  23. <span style="white-space: normal;"><span style="white-space:pre">        </span>}</span>

5、显示照片:

a43b500493a094a1baf527d7116d279.jpg