CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

A question about oled ssd1306 bitmap
Goto page 1, 2, 3, 4  Next
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
bulut_01



Joined: 24 Feb 2024
Posts: 62

View user's profile Send private message

A question about oled ssd1306 bitmap
PostPosted: Sat Mar 09, 2024 7:17 am     Reply with quote

Good day friends, I am not very experienced about CCS, I want to show the code I created on the Oled SSD1306 screen. I am using the x.115 version of CCS and I am using the 1306 library. The code below does not compile.. image_bits How can I send the code on the screen?

Code:
static const unsigned char image_bits[] = {0x00,0x00,0x00,
0x00,0x00,0x00,0xfe,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x01,0x3e,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0xc0,0x01,0x00,0x00,0x00,0x00,0x00,0x00
,0x20,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x04,0x00,0x01
,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x18,0x00,0x03,0x00,0x00,0x00,0x00,0x08,0x00,
0x00,0x20,0x00,0x0c,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x40,0x00,0x70,0x00,0x00,
0x00,0x00,0x04,0x00,0x00,0x80,0x01,0x80,0x01,0x00,0x00,0x00,0x04,0x00,0x00,0x00,
0x02,0x00,0x06,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x0c,0x00,0x18,0x00,0x00,0x00,
0x02,0x00,0x00,0x00,0x10,0x00,0xe0,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x20,0x00,
0x00,0x03,0x00,0x00,0x01,0x00,0x00,0x00,0x20,0x00,0x00,0x1c,0x00,0x00,0x01,0x00,
0x00,0x00,0x40,0x00,0x00,0xe0,0x00,0x80,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00
,0x0f,0x80,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0xf0,0x80,0x00,0x00,0x00,0x00
,0x80,0x00,0x00,0x00,0x00,0x8f,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0xf0
,0x01,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x80,0xfe,0x00,0x00,0x00,0x80,0x00
,0x00,0x00,0x00,0x80,0x00,0x7f,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x80,0x00,0x80,
0x7f,0x00,0x40,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x80,0xff,0x3f,0x00,0x00,0x00,
0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,
0x00,0x00,0x00};


The code I sent to the screen
Code:
oled_text57(1, 10, image_bits, 1, 1);
E_Blue



Joined: 13 Apr 2011
Posts: 417

View user's profile Send private message

PostPosted: Sat Mar 09, 2024 9:18 am     Reply with quote

What is oled_text57(????)
Where is the image size?

To send data you should call that table byte by byte.

Something similar like



Code:

unsigned int16 x;

for(x=0;x<imageByteCount;x++)
{
    imageSenderSub(image_bits[x]);
}


That's the basic idea. I don't see that in your code.
_________________
Electric Blue
temtronic



Joined: 01 Jul 2010
Posts: 9221
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sat Mar 09, 2024 9:28 am     Reply with quote

A 'link' to the 'driver' you're using would help.
I'll assume the '57' in the function means a 5 pixel by 7 pixel character ?

Probably need a variable that contains the length of the array,so when you make the call, it dumps the entire array to the screen ?
E_Blue



Joined: 13 Apr 2011
Posts: 417

View user's profile Send private message

PostPosted: Sat Mar 09, 2024 9:38 am     Reply with quote

temtronic wrote:
A 'link' to the 'driver' you're using would help.
I'll assume the '57' in the function means a 5 pixel by 7 pixel character ?

Probably need a variable that contains the length of the array,so when you make the call, it dumps the entire array to the screen ?


If that array is not one image and they are several he should use a 2 dimensional array or it could get messy really easy.
_________________
Electric Blue
bulut_01



Joined: 24 Feb 2024
Posts: 62

View user's profile Send private message

PostPosted: Sat Mar 09, 2024 10:11 am     Reply with quote

I am not very knowledgeable on this subject. Can you tell me the code to send the above code to the screen? I am using the 1306 library.
bulut_01



Joined: 24 Feb 2024
Posts: 62

View user's profile Send private message

PostPosted: Sat Mar 09, 2024 11:16 am     Reply with quote

can you help with this
temtronic



Joined: 01 Jul 2010
Posts: 9221
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sat Mar 09, 2024 11:42 am     Reply with quote

Post a 'link' to the '1306' library !
bulut_01



Joined: 24 Feb 2024
Posts: 62

View user's profile Send private message

PostPosted: Sat Mar 09, 2024 2:27 pm     Reply with quote

....

Last edited by bulut_01 on Sat Mar 09, 2024 6:28 pm; edited 1 time in total
temtronic



Joined: 01 Jul 2010
Posts: 9221
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sat Mar 09, 2024 2:33 pm     Reply with quote

OK, didn't know it was a CCS driver, which you're NOT supposed to post.
So please delete it though one of the moderators may...
bulut_01



Joined: 24 Feb 2024
Posts: 62

View user's profile Send private message

PostPosted: Sat Mar 09, 2024 2:36 pm     Reply with quote

Please guide me on this issue, what should I do?
temtronic



Joined: 01 Jul 2010
Posts: 9221
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sat Mar 09, 2024 2:46 pm     Reply with quote

goto your post that has the ssd1306.c driver in and 'delete' the post
bulut_01



Joined: 24 Feb 2024
Posts: 62

View user's profile Send private message

PostPosted: Sat Mar 09, 2024 2:53 pm     Reply with quote

Are you saying this should I delete the ssd1306 library and add another library?
temtronic



Joined: 01 Jul 2010
Posts: 9221
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sat Mar 09, 2024 3:53 pm     Reply with quote

NO, I'm saying you need to delete your POSTING that has the SSD1306 driver in it !
You're not allowed to POST 'drivers' that CCS supplies...it's in the 'rules'.
bulut_01



Joined: 24 Feb 2024
Posts: 62

View user's profile Send private message

PostPosted: Sat Mar 09, 2024 5:20 pm     Reply with quote

Code:
static const unsigned char wifi[] = {0x80,0x0f,0x00,0x60,0x30,0x00,0x18,0xc0,
0x00,0x84,0x0f,0x01,0x62,0x30,0x02,0x11,0x40,0x04,0x0a,0x87,0x02,0xc4,0x1f,0x01
,0xe8,0xb8,0x00,0x70,0x77,0x00,0xa0,0x2f,0x00,0xc0,0x1d
,0x00,0x80,0x0a,0x00,0x00,0x07,0x00,0x00,0x02,0x00,0x00,0x00,0x00};

Code:
//draw BMP stored in ROM
void SSD1306_ROMBMP(uint8_t x, uint8_t y, rom uint8_t *bitmap, uint8_t w, uint8_t h)
{
  for( uint16_t i = 0; i < h/8; i++ )             
  {   
    for( uint16_t j = 0; j < (uint16_t)w * 8; j++ )
    {     
      if( bit_test(bitmap[j/8 + i*w], j % 8) == 1 )                           
        SSD1306_DrawPixel(x + j/8, y + i*8 + (j % 8));
      else
        SSD1306_DrawPixel(x + j/8, y + i*8 + (j % 8), 0);
    }
  }
}


Code:
SSD1306_Begin(SSD1306_SWITCHCAPVCC, SSD1306_I2C_ADDRESS);
SSD1306_Display();
delay_ms(100);
SSD1306_ClearDisplay();
SSD1306_ROMBMP(58, 17, wifi, 19, 15);


I use the ROMBMP algorithm and a ridiculous shape appears on the screen. How can I send the above static const unsigned char wifi shape to the screen correctly?
temtronic



Joined: 01 Jul 2010
Posts: 9221
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sat Mar 09, 2024 6:16 pm     Reply with quote

so.. what's stored in the array called 'bitmap'

and

you still haven't deleted the CCS driver in your previous post !!!

If you don't do that soon, you'll be in trouble with the forum !!!
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page 1, 2, 3, 4  Next
Page 1 of 4

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group