I've a simple piece of Arduino code that writes the whole screen black, then white, over and over.
On the standard setting it achieves 10 FPS, on "Here be dragons", with SPI at 1/2 processor speed and 200MHz overclock I can push it to 16.7 fps.
Should it be possible to reach 30 or even 60fps?
- Code: Select all | TOGGLE FULL SIZE
#include <Adafruit_GFX.h>
#include <Adafruit_SharpMem.h>
#define WIDTH 400
#define HEIGHT 240
#define CS 10
Adafruit_SharpMem display(SCK,MOSI,CS,WIDTH,HEIGHT);
int frameCount=0;
float fps;
unsigned long startTime;
void setup(void)
{
Serial.begin(9600);
display.begin();
display.clearDisplay();
startTime=millis();
}
void loop(void){
frameCount++;
Flicker(frameCount);
fps=float(scroll)*1000/float(millis()-startTime);
Serial.println(fps,1);
}
void Flicker(int offsetx){
for(unsigned x=0; x<WIDTH; ++x){
for(unsigned y=0; y<HEIGHT; ++y){
display.drawPixel(x,y,offsetx%2);
}
}
display.refresh();
}
Or is the drawPixel command slowing things down to great extends? Can that be replaced with a simple bitwrite somewhere?