9 years, 4 months ago.

Xadow M0, RGB_OLED with SSD1331 driver

How I can use this libs. with Xadow_M0.

Thanks.

Question relating to:

ALO-095BWNN-J9 aitendo OLED 96x64 SPI model Ver1.04

1 Answer

9 years, 4 months ago.

Hi,

I glanced at that library, seems it's generic so should work with your platform. So check the interface it provides https://developer.mbed.org/users/TETSUYA/code/OledLib/file/7c25a9403243/spioled96x64.h. It does nto have any example, at least not in their repository. You can search on mbed if you dont find anybody using this library.

Please provide the headline next time. Use. does not say much what is this question about. Thanks

Regards,
0xc0170

Accepted Answer

Hi.

Yes I find this libs, but I dont have any idea how to use it. I have some code, but not working =/. I have original PCB from seeedstudio Xadow M0 and RGB oled. I'm looking into schematic and conection is ok. I use this code, but not Working (there are some bugs like this: Compiler Error L6406E):

  1. include "mbed.h"
  2. include "spioled96x64.h"

SPI spi(P0_9, P0_20, P0_10); mosi, miso, sclk SPIOLED96x64 oled(p14, p16, p15, p11, p12, p13); cs res dc mosi miso sck SPIOLED96x64 oled(P0_15, P0_18, P0_4, P0_9, P0_8, P0_10); cs res dc mosi miso sck

const char ng_str[] = {0x82,0x6d,0x82,0x66,0x00}; 全角NG const char ok_str[] = {0x82,0x6e,0x82,0x6a,0x00}; 全角OK

const char Large_s[] = {0x82,0x60,0x82,0x61,0x82,0x62,0x00}; ABC int main() { int lpx,lpy, ly, i; int lpx,lpy, ly; char s[32] = { 0 };

while(1){ oled.Fill_Screen(0x001f); full red color in OLED wait_ms( 100 );

oled.Fill_Screen(0x07e0); full green color in OLED wait_ms( 100 );

oled.Fill_Screen(0xf800); full blue color in OLED wait_ms( 100 );

oled.Box(10,10, 90,60,oled.ColorConv(0x1f,0x00,0x00) ,0); wait_ms( 1500 );

oled.Box(10,10, 45,60,oled.ColorConv(0x00,0x1f,0x00) ,1); wait_ms( 1500 );

ly=0; oled.SetFontSize(CS_NORMAL); oled.ChangeFontColor(0x001f); oled.locate(0, ly); oled.printf( "ABC%s1234", (char *)Large_s ); oled.CS_Conv(&lpx, &lpy); ly += (Y_Witch*lpy);

sprintf( s, "ABC%s1234", (char *)Large_s ); oled.SetFontSize(CS_HIGH); oled.ChangeFontColor(0x07e0); oled.locate(0, ly); oled.puts(s); oled.CS_Conv(&lpx, &lpy); ly += (Y_Witch*lpy);

oled.SetFontSize(CS_WH); oled.locate(0, ly); oled.puts(s); oled.CS_Conv(&lpx, &lpy); ly += (Y_Witch*lpy);

wait_ms(2500);

ly=0; oled.Fill_Screen(oled.ColorConv(0x1f,0x1f,0x00)); oled.SetFontSize(CS_WHx36); oled.ChangeFontColor(0x001f); oled.locate(0, ly); oled.puts((char*)ng_str); oled.CS_Conv(&lpx, &lpy); ly += (Y_Witch*lpy); wait_ms(2500);

ly=0; oled.Fill_Screen(oled.ColorConv(0x00,0x00,0x1f)); oled.ChangeFontColor(0x07e0); oled.locate(0, ly); oled.puts((char*)ok_str); oled.CS_Conv(&lpx, &lpy); ly += (Y_Witch*lpy); wait_ms(2500);

oled.circle (30, 40, 30 ,oled.ColorConv(0x0f,0x0f,0x00) , 1); oled.line( 0, 0, Dis_X_MAX, Dis_Y_MAX, oled.ColorConv(0x00,0x1f,0x1f) ,0 ); oled.line( Dis_X_MAX, 0, 0, Dis_Y_MAX, oled.ColorConv(0x00,0x1f,0x1f) ,1 ); wait_ms(2500);

} }

posted by Štefan Sebeš 12 Jan 2015