LoginSignup
0
0

More than 1 year has passed since last update.

STM32L010とDS1307で時間合わせ

Last updated at Posted at 2022-08-07

x Mbed2リビジョン125です。

目的
RTCの時間合わせ
タイミングよく実行する

ちゃんと原文を確認してね!!

x 非営利、研究調査目的で引用

o_con625.jpg



//i2c_oled16x24_64_ds1307_set_010_1

#include "mbed.h"

#define HH  17
#define MM  28

int main() {
    char data_read[8];  //i2cバッファー
    data_read[0]=0;
    data_read[1]=0;
    data_read[2]= ( MM /10)*16+( MM %10);
    data_read[3]= ( HH /10)*16+( HH %10);
    data_read[4]=3;    
    data_read[5]=1;
    data_read[6]=1;
    data_read[7]=0x20;

    I2C i2c(PA_10, PA_9);
    i2c.write(  (0xD0)  , data_read, 8);

    while(1){} //無限ループ
} // main



0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0