Ult
Projects
Urt
Ll Lr

Ult
Featured
Urt
Ll Lr

Ult
Log in
Urt
Ll Lr


Stealth_front_wide_small
Reddit Twitter Digg Facebook Delicious Stumbleupon
1 image, 2 parts, 1 comment

30 FPS Hack

The 30 FPS Hack is a low-level graphics driver hack. It optimizes the TouchShield’s painting function to allow faster drawing routines.

Parts for 30 FPS Hack:

This code can be uploaded to the TouchShield to draw full frame at up to 30 frames a second (FPS). The screen fades quickly between two colors.

Make sure you switch to the TouchShield core before compiling!

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#define WIDTH 128
#define HEIGHT 128
#define NUMPIXELS (WIDTH*HEIGHT)

#define PIXEL(x,y) (y*WIDTH+x)
#define SETCOLOR(r,g,b) {  LCD_DATA_HIGH = (r); 
                           LCD_DATA_MED = (g); 
                           LCD_DATA_LOW = (b); }

void setup()
{
}

void loop()
{
    int pix = 0;
        char colR = 0, colG = 0, colB = 0;
    lcd_setRow(0,127);
    lcd_setColumn(0,127);

        lcd_write_C(0x5C); //enable write RAM
    while(1)

    {
        SETBIT(LCD_CTRL_PORT,LCD_DC);
        CLRBIT(LCD_CTRL_PORT,LCD_CS);
        for(pix = 0; pix < NUMPIXELS; pix++)

        {
                        CLRBIT(LCD_CTRL_PORT,LCD_WR);
                        SETCOLOR(colR,colG,colB);

            SETBIT(LCD_CTRL_PORT,LCD_WR);
        }
                colB++;
                if (!colB)
                {
                  colG++;
                  if (!colG)
                    colR++;
                }
    }
}

I’ve uploaded the rest of the TouchShield’s built-in commands are over at the function reference wiki.

1 Comment on 30 FPS Hack

Sasha G Jan 15 2009

Is the 30 FPS hack already implemented in the TS Slide? I have been trying to make heads and tails of the numerous example files and how to modify them to work on the Slide. Digging through the OLED.h file to see what is implemented differently from the LCD.h file is fascinating, but frustrating.

As an aside, I am having a tough go at getting Arduino-to-Slide(and vice-versa) communication working. I get “Serial not declared in this scope” type errors when I try to implement serial functions in my TS Slide sketches. I’ll keep trying _

Awesome gear, though…



Add A Comment:

Get in touch if you have any questions, or ideas for something you want me to build.