|
函數(shù)
- // Parameters : x,y -- 起始點(diǎn)坐標(biāo)(x:0~127, y:0~7); ch[] -- 要顯示的字符串; TextSize -- 字符大小(1:6*8 ; 2:8*16)
- // Description : 顯示codetab.h中的ASCII字符,有6*8和8*16可選擇
- void OLED_ShowStr(unsigned char x, unsigned char y,unsigned char j,unsigned char TextSize)
- {
- unsigned char c = 0,i = 0;
- // unsigned char j = 0;
- switch(TextSize)
- {
- case 1:
- {
- while(j != '\0')
- {
- c = j - 32;
- if(x > 126)
- {
- x = 0;
- y++;
- }
- OLED_SetPos(x,y);
- for(i=0;i<6;i++)
- WriteDat(F6x8[c][i]);
- x += 6;
- j++;
- }
- }break;
- case 2:
- {
- while(j != '\0')
- {
- c = j - 32;
- if(x > 120)
- {
- x = 0;
- y++;
- }
- OLED_SetPos(x,y);
- for(i=0;i<8;i++)
- WriteDat(F8X16[c*16+i]);
- OLED_SetPos(x,y+1);
- for(i=0;i<8;i++)
- WriteDat(F8X16[c*16+i+8]);
- x += 8;
- j++;
- }
- }break;
- }
- }
復(fù)制代碼
調(diào)用函數(shù)
OLED_ShowStr(2,1,1,1);
編譯錯(cuò)誤信息
error: #167: argument of type "int" is incompatible with parameter of type "unsigned char *"
新手實(shí)在弄不明白。
|
|