// // main.c // OneBitDisplay library test program // Demonstrates many of the features for OLED displays // #include #include #include #include #include #include #include #include #include #include #include "../../src/OneBitDisplay.cpp" volatile int iStop = 0; #define OLED_TYPE OLED_128x64 #define OLED_ADDR 0x3c #define FLIP180 0 #define INVERT 0 #define HW_I2C 1 // On Linux this is the I2C bus number (SDA_PIN) for HW I2C #define SDA_PIN 1 // On Linux this is the I2C device address #define SCL_PIN 0x3c #define RESET_PIN -1 // This is not controlled on Linux through the API // On the Raspberry PI, see /boot/config.txt #define SPEED 0 #define MAX_THREADS 2 void *OLEDThread(void *); OBDISP obd[MAX_THREADS]; void my_handler(int signal) { iStop = 1; } /* my_handler() */ int main(int argc, const char *argv[]) { int i, ID[MAX_THREADS]; pthread_t tinfo[MAX_THREADS]; struct sigaction sigIntHandler; size_t ret; // Set CTRL-C signal handler sigIntHandler.sa_handler = my_handler; sigemptyset(&sigIntHandler.sa_mask); sigIntHandler.sa_flags = 0; sigaction(SIGINT, &sigIntHandler, NULL); for (i=0; i