Newer
Older
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <wiringPi.h>
#include <wiringPiI2C.h>
const int OLED = 0x3d;
int main(int argc, char const *argv[])
{
int fd = wiringPiI2CSetup(OLED);
if (fd < 0) {
perror("I2C");
exit(EXIT_FAILURE);
}
int response = wiringPiI2CRead(fd);
printf("%x", response);
return 0;
}