root@buildroot:~# i2cdetect -y 0
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 6f
70: -- -- -- -- -- -- -- --
root@buildroot:~#
@pnru_gitlab How do you think we should implement sleep in the lcc library?
See here for some ideas. Untested code.
#include <stdio.h>
extern int sleep(int sec);
extern int usleep(int usec);
int main() {
printf("Sleep for 2 seconds\n");
sleep(2);
printf("Sleep for 1M microseconds\n");
usleep(1000000);
return 0;
}
root@buildroot:~# time ./a.out
Sleep for 2 seconds
Sleep for 1M microseconds
real 0m 3.02s
user 0m 0.00s
sys 0m 0.01s
self._i2c.writeto_mem(MCP7940.ADDRESS, 0x03, bytes([0x07 | 8])) # weekday | battery_backup