Page 1 of 2

GB DS module

PostPosted: Fri Jun 05, 2015 11:43 am
by adekto
yes you read that right gamebuino DS (dual screen) module

IMG_0468.JPG
IMG_0468.JPG (1.28 MiB) Viewed 10443 times


also yes my red gamebuino looks amazing

this needs the u8glib: https://code.google.com/p/u8glib/
helo world code:
Code: Select all
//imports the library's
#include <SPI.h>
#include <Gamebuino.h>
#include <U8glib.h>
//creates a Gamebuino object named gb
Gamebuino gb;
//creates the ds object for the oled sceen
U8GLIB_SSD1306_128X64 ds(U8G_I2C_OPT_DEV_0|U8G_I2C_OPT_NO_ACK|U8G_I2C_OPT_FAST);


//sprite 48,64
const byte sprite[] PROGMEM = {0x4,0x80,0x0,0x0,0x0,0x0,0xC,0x80,0x0,0x0,0xFC,0x0,0x8,0x80,0x0,0x3,0x84,0x0,0x8,0xC0,0x0,0x6,0x44,0x0,0x19,0x40,0x0,0x1D,0x84,0x0,0x11,0x40,0x0,0x33,0x4,0x0,0x31,0x40,0x0,0xEE,0x6,0x0,0x21,0x73,0xE1,0x9C,0xA,0x0,0x23,0x9E,0x3F,0x78,0x12,0x0,0x23,0xE9,0x8C,0xF0,0x2,0x0,0x23,0xEA,0xEB,0xF0,0x2,0x0,0x23,0xF1,0x57,0xF0,0x2,0x0,0x69,0xF0,0xA7,0xF0,0x16,0x0,0x5E,0xF0,0x7,0xF8,0x34,0x0,0x5F,0xF8,0xF,0xFC,0x74,0x0,0x5F,0xF8,0xF,0xFE,0xF4,0x0,0x5F,0xFE,0x3F,0xFF,0xEC,0x0,0x6F,0x1F,0xFC,0x3F,0xE8,0x0,0x36,0xEF,0xFB,0xDF,0xD8,0x0,0x1A,0xD7,0xF6,0x6F,0xB0,0x0,0xC,0x87,0xF4,0x2D,0x30,0x0,0x8,0x87,0xF4,0x22,0xD8,0x0,0xC,0x8F,0xF4,0x27,0xEC,0x0,0xA,0xDF,0xFE,0x6F,0xF6,0x0,0x3B,0xFF,0xFF,0xFF,0xF2,0x0,0xE7,0xFF,0xFF,0xFF,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0,0x0,0x3F,0xFC,0x0,0x0,};
// sprite y position
byte y = 64;
void setup(){
  // initialize the Gamebuino object
  gb.begin();
  //display the main menu:
  gb.titleScreen(F("ds hello wold"));
  gb.popup(F("Let's go!"), 100);
}
void gbLoop(){
    //prints Hello World! on the screen
    gb.display.println(F("Hello ds module!"));
    //declare a variable named count of type integer :
    int count;
    //get the number of frames rendered and assign it to the "count" variable
    count = gb.frameCount;
    //prints the variable "count"
    gb.display.println(count);
    //move the sprite on the ds module
    if(y > 1){
      y = y - 1;
    }
}

void dsDraw(){
  // set the font for the ds module
  ds.setFont(u8g_font_unifont);
 
  ds.drawStr( 0, 22, "hi gamebuino!");
  ds.drawBitmapP( 79, y, 6, 64, sprite);
}

// the loop routine runs over and over again forever
void loop(){
  if(gb.update()){
  // normal gamebuino loop
  gbLoop();
 // picture loop for ds module
  ds.firstPage(); 
  do {
    dsDraw();
  } while( ds.nextPage() );
  }
 
}

Re: GB DS module

PostPosted: Fri Jun 05, 2015 1:06 pm
by Sorunome
That is looking awesome!
Do you mind releasing some more technical details? :)

Re: GB DS module

PostPosted: Fri Jun 05, 2015 1:30 pm
by adekto
what do you want to know

its just ssd1306 oled display over I2C (from ebay) and 4 wires

im straight up using the u8glib in the pong example
only wierd thing im getting is on start up you will get noise on the oled screen

just tested some bitmaps, bit difrent format atm need to fix that


the display takes images as a byte array similar like the gb format exept for the W H at the bigining of the array
using u8g drawing with
Code: Select all
u8g.drawBitmapP(x,y,w/8,h,imageArray);

Re: GB DS module

PostPosted: Mon Jun 08, 2015 11:43 pm
by Awesomemario128
Cool

Re: GB DS module

PostPosted: Tue Jun 09, 2015 7:46 am
by adekto
so the pricing of the oled is resonable and you sude get one under €10
a solder iron, proto-board and 4 female header will help ofcource

pin out from left to right on gamebuino, will work on ether connector
0v --- gnd
3v3 --- vcc
da --- sda
ck --- scl

if you have intrest in this module and wish to have one maybe a bit more sleeker on a pcb, we can get some made if there is enugh interest

Re: GB DS module

PostPosted: Thu Jul 09, 2015 2:09 pm
by adekto
Did some soldering for probebly the easyest conection ever
image.jpg
image.jpg (885.73 KiB) Viewed 10296 times

Re: GB DS module

PostPosted: Mon Jul 13, 2015 1:54 pm
by Skyrunner65
It might seem insane to say right now, but why not use the same kind of screen that the GB has?

Other than that, this is great!

Re: GB DS module

PostPosted: Mon Jul 13, 2015 9:09 pm
by adekto
wel mainly since the nokia 5110 screen is realy realy bad (i mean have you seen that ghosting?)
also hey u know that arduboy thing? yea you basicly play there games with some tweaking

and the higher resolution is realy nice to have

Re: GB DS module

PostPosted: Tue Jul 14, 2015 3:32 am
by erico
but but the ghosting is one of the charms of it :roll:

Re: GB DS module

PostPosted: Tue Jul 14, 2015 12:14 pm
by adekto
sure it has its scharms but not all games work well with its
anything with fast movement becoms a mess
this little thing is just an option for you to add

anyway plz tell me if you guys are interested in more of this
other i2c sceens work aswel btw