Skip to content

Instantly share code, notes, and snippets.

@city41
Created August 26, 2018 15:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save city41/14f5eb8c15a131f128b62ebddde950c5 to your computer and use it in GitHub Desktop.
Save city41/14f5eb8c15a131f128b62ebddde950c5 to your computer and use it in GitHub Desktop.
ardbitmap vertical mirror problem
#include <SPI.h>
#include <EEPROM.h>
#include <Arduboy2.h>
#include <math.h>
Arduboy2 arduboy;
#define ARDBITMAP_SBUF arduboy.getBuffer()
#include <ArdBitmap.h>
ArdBitmap<WIDTH, HEIGHT> ardbitmap;
const uint8_t PROGMEM candle_bmp[] = {
0x00, 0xfc, 0x02, 0x02, 0x02, 0x02, 0xc2, 0xda, 0xe2, 0x02, 0x02, 0x02, 0x02, 0x02, 0xfc, 0x00,
0x00, 0x3f, 0x40, 0x48, 0x58, 0x58, 0x5f, 0x58, 0x5f, 0x58, 0x5c, 0x52, 0x4c, 0x40, 0x3f, 0x00,
};
void setup() {
arduboy.begin();
arduboy.setFrameRate(10);
}
int16_t y = 0;
void loop() {
if (!arduboy.nextFrame()) {
return;
}
if (arduboy.pressed(UP_BUTTON)) {
y -= 1;
}
if (arduboy.pressed(DOWN_BUTTON)) {
y += 1;
}
arduboy.clear();
ardbitmap.drawBitmap(4, y, candle_bmp, 16, 16, WHITE, 0, MIRROR_VERTICAL);
arduboy.setCursor(40, 20);
arduboy.print(y);
arduboy.display();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment