Well, at least i thought that stuff and went ahead to try it out!
Below I assume I already filled the screen with black.
DISCLAIMER: Trying these code snippets might break your screen!
So let's try first turning on and off in an infinite loop. Unfortunately that didn't yield any result, the screen was only white. So I went ahead to add delay(1); in between each one to see what is happening. Well, then funny flickering horizontal lines appeared (They look cooler IRL).
Sketch:
- Code: Select all
#include <SPI.h>
#include <Gamebuino.h>
Gamebuino gb;
void setup(void) {
gb.begin();
gb.display.setColor(BLACK);
gb.display.fillRect(0,0,84,48);
gb.display.update();
noInterrupts();
}
void loop(void) {
gb.display.command(PCD8544_FUNCTIONSET | PCD8544_EXTENDEDINSTRUCTION);
gb.display.command(PCD8544_SETVOP | 0x7f);
while(1){
gb.display.command(PCD8544_FUNCTIONSET | 4);
delay(1);
gb.display.command(PCD8544_FUNCTIONSET);
delay(1);
}
}
Result:
Now that wasn't too exciting, pretty boring. So I went ahead and wrote a sketch which keeps on switching the contrast between min/max. This also needed some fine-tuned delays but the result was just a gray screen. booooring, we want more exciting stuff!
So, how about we combind turning the screen of/on with setting the contrast to max/min? Well, now THAT is something way more interesting (and aaaawesome looking!)
Sketch:
- Code: Select all
#include <SPI.h>
#include <Gamebuino.h>
Gamebuino gb;
void setup(void) {
gb.begin();
gb.display.setColor(BLACK);
gb.display.fillRect(0,0,84,48);
gb.display.update();
noInterrupts();
}
void loop(void) {
gb.display.command(PCD8544_FUNCTIONSET | PCD8544_EXTENDEDINSTRUCTION);
gb.display.command(PCD8544_SETVOP | 0x7f);
while(1){
gb.display.command(PCD8544_FUNCTIONSET | 4);
gb.display.command(PCD8544_FUNCTIONSET | PCD8544_EXTENDEDINSTRUCTION);
gb.display.command(PCD8544_SETVOP | 0x7f);
gb.display.command(PCD8544_FUNCTIONSET | PCD8544_EXTENDEDINSTRUCTION);
gb.display.command(PCD8544_SETVOP | 0);
}
}
Result:
As I said, probably not too healthy
Interestingly enough, that horizontal line appears on a random row when starting the program, and only if it is in the lower part of the screen it yields that cool particle effect.
Unfortunately I couldn't find any neat effects playing around with the voltage and thelike.