Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
OLED i2c 128x64 script test
#include <iostream>
#include "ofxGPIO.h"
#define OLED 0x3C
#define WIDTH_OLED 128
#define HEIGHT_OLED 64
int main(int argc, char *argv[])
{
if(argc > 2)
{
int a = strtol(argv[1], NULL, 16);
int b = strtol(argv[2], NULL, 16);
I2CBus * bus;
bus = new I2CBus("/dev/i2c-1");
bus->addressSet(OLED);
for (int i = 0; i < (( WIDTH_OLED * HEIGHT_OLED / 8 ) / 16); i++)
{
bus->writeByte(a, b);
}
}
return 0;
}
@kashimAstro

This comment has been minimized.

Copy link
Owner Author

commented Jan 24, 2017

g++ -Wall -o oled OLEDpi.cpp ../src/gpio.cpp ../src/i2cBus.cpp ../src/rpiPWM1.cpp ../src/smbus.cpp -DCOMPILE_WITHOUT_OPENFRAMEWORKS=1 -I../src/ -std=c++11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.