1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
#include <stdio.h>
#include "systick.h"
#include "i2c.h"
#include "oled_i2c.h"
#include "rocker_driver.h"
int main(){
systick_config();
i2c_init();
oled_init();
oled_clear_all();
char temp_string[20]; // ֵתΪַĽ
oled_show_string(20,0, (uint8_t *)"ROCKER Test", 16);
rocker_init();
//ʾdestination_1destination_2
while(1){
// ʾҡ˵Xֵ
sprintf(temp_string, "X : %5d", rocker_data[0]);
oled_show_string(1,2, (uint8_t *)temp_string, 16);
// ʾҡ˵Yֵ
sprintf(temp_string, "Y : %5d", rocker_data[1]);
oled_show_string(1,4, (uint8_t *)temp_string, 16);
}
}
|