Home > other >  Positively charged atoms OLED display string functions, some places don't understand
Positively charged atoms OLED display string functions, some places don't understand

Time:09-17

Void OLED_ShowString (u8 u8 x, y, const u8 * p, u8 size)
{
While ((* p<='-') & amp; & (* p>=' '))//distinguish the illegal characters!
{
If (x> (128 - (size/2)))//the following several don't understand, trouble as far as possible a detailed explanation
{x=0; Y +=size; }
If (y> (64 - size))
{y=x=0; OLED_Clear (); }
OLED_ShowChar (x, y, * p, the size, 1);
X +=the size/2;
p++;
}

}

CodePudding user response:

Void OLED_ShowString (u8 u8 x, y, const u8 * p, u8 size)
{
While ((* p<='-') & amp; & (* p>=' '))//distinguish the illegal characters!
{
If (x> (128 - (size/2)))//the following several don't understand, trouble as far as possible a detailed explanation to judge whether the X coordinate is at the end of the line can write an ASCII characters
{x=0; Y +=size; }//present if a line is a new line, the SIZE is the SIZE of a character, such as 16 * 16; 32 * 32, such as
If (y> (64 - size))//if the characters show is the last line,
{y=x=0; OLED_Clear (); }//clear screen and x, y value 0 to screen coordinates of the origin,
OLED_ShowChar (x, y, * p, the size, 1);//in the current coordinates (x, y) showed a character (* p), as for the last parameter "1" can be said is covering the display or overlay, without the function prototype, so not clear,
X +=the size/2;//show the original one character at a time, coordinate with the width of a character to the coordinates of the next character,
p++;//read the next character,
}

}
  • Related