 # trying to understand custom characters and the 8_bit format[SOLVED]

hello arduino community , i love you guys! well when we want to create custom characters we create an array of 7 bytes (or 8 bytes) . all of them start with letter B , for example `0B00000` well i understand what the digits on the right of the letter B are for , but not the letter B itself and the zero to its left , i dont understand what they mean and why we put them there . also i found a converter from character to byte code and the conversion did not give me no letter B , so is it something specific to the arduino language ?

well i understand what the digits on the right of the letter B are for , but not the letter B itself and the zero to its left

The initial zero is there to inform the compiler that this is a number. The 'B' tells the compiler that this is a 'Binary' number.

Don

There are 3 common ways to show data: 1) show each bit individually, BIN format 0b01011010 or B01011010, shows bit 7 on the left (MSB) and 0 on the right (LSB)

2) show the data in HEX format 0x5A (0101 is 5, 1010 is A). 0b00000000 = 0x00 0b00000001 = 0x01 0b00000010 = 0x02 0b00000011 = 0x03 0b00000100 = 0x04 0b00000101 = 0x05 0b00000110 = 0x06 0b00000111 = 0x07 0b00001000 = 0x08 0b00001001 = 0x09 0b00001010 = 0x0A 0b00001011 = 0x0B 0b00001100 = 0x0C 0b00001101 = 0x0D 0b00001110 = 0x0E 0b00001111 = 0x0F

3) show the data in Decimal format 0x00 thru 0x0F = 0 to 15 0x00 thru 0xFF = 0 to 255

Depending on what you are doing, one format might be better over another. When designing hardware, I often think in binary terms to make it easier to visualize bit placement. Same for HEX - when looking at data coming from devices, manipulating it to combine nibbles (1/2 upper or lower 4 bits in a byte), it can be easier to see the data in HEX format.

Decimal - 0 to 255 just doesn't tell you much about the data.

The compiler will give you errors if you have too many binary bits, or not enough hex digits.

What's this have to do with "crystal library library"?

thank you guys