Skip to content
Extraits de code Groupes Projets
OLED.cpp 380 octets
Newer Older
  • Learn to ignore specific revisions
  • 
    #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;
    }