Moderators: adafruit_support_bill, adafruit


int getpixel(uint8_t x, uint8_t y);int SSD1306::getpixel(uint8_t x, uint8_t y) {
if(buffer[x+ (y/8)*SSD1306_LCDWIDTH] & _BV((y%8)))
return 1;
else
return 0;
}void drawint(uint8_t x, uint8_t line, int c);void SSD1306::drawint(uint8_t x, uint8_t line, int c) {
int offset = 0;
boolean leadingZeroes = true;
if(c<0) {
drawchar(x, line, '-');
c = -c;
offset += 6;
}
for(int i = 4; i >=0; i--) {
char digit = c / pow(10, i);
if(digit != 0)
leadingZeroes = false;
if(!leadingZeroes) {
c -= digit*pow(10, i);
drawchar(x + offset, line, digit + 48);
offset += 6;
}
}
if(leadingZeroes)
drawchar(x + offset, line, '0');
}Return to Other Adafruit products
Users browsing this forum: Google [Bot] and 6 guests