欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136

標題: 求助單片機點陣顯示表情發暗原因 [打印本頁]

作者: yu1994    時間: 2020-8-10 21:08
標題: 求助單片機點陣顯示表情發暗原因
#include<reg52.h>
sbit a=P0^0;
sbit b=P0^1;
sbit c=P0^2;
sbit OE0=P0^3;
sbit OE1=P0^4;
sbit OE2=P0^5;
sbit KEY1=P3^2;
sbit KEY2=P3^3;
sbit KEY3=P3^4;
sbit KEY4=P3^5;
unsigned char code LedChar[7][8]={
{0xC3,0x81,0x00,0x00,0x00,0x81,0xFF,0xFF},
{0xFF,0x81,0x00,0x00,0x00,0x81,0xFF,0xFF},
{0xFF,0xFF,0x00,0x00,0x00,0xFF,0xFF,0xFF},
{0xFF,0xFF,0xFF,0x00,0xFF,0xFF,0xFF,0xFF},               //不按按鍵時
{0xEF,0xDF,0xBF,0x00,0xBF,0xDF,0xEF,0xFF},               //左轉
{0xF7,0xFB,0xFD,0x00,0xFD,0xFB,0xF7,0xFF},               //右轉
{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x66,0x99},                //W
};               
void buan();                                     //不按按鍵函數
void ting();                                         //剎車時函數
void you();                                          //左轉時函數
void zuo();                                          //右轉時函數
void main()
{
while(1)
{
  if(KEY1==0)
  {
   you();
  }
  else if(KEY2==0)
  {
   zuo();
  }
  else
  {
  buan();
  }
}
}
/*不按按鍵*/
void buan()
{
static unsigned char cnt1=0;
static unsigned char  d=0;
static unsigned int   tmr=0;
static unsigned char i=0;
P1=0xFF;
switch(i)
{
  case 0:a=0;b=0;c=0;OE0=0;OE1=1;OE2=1;i++;P1=LedChar[cnt1][0];break;
  case 1:a=0;b=0;c=1;OE0=0;OE1=1;OE2=1;i++;P1=LedChar[cnt1][1];break;
  case 2:a=0;b=1;c=0;OE0=0;OE1=1;OE2=1;i++;P1=LedChar[cnt1][2];break;
  case 3:a=0;b=1;c=1;OE0=0;OE1=1;OE2=1;i++;P1=LedChar[cnt1][3];break;
  case 4:a=1;b=0;c=0;OE0=0;OE1=1;OE2=1;i++;P1=LedChar[cnt1][4];break;
  case 5:a=1;b=0;c=1;OE0=0;OE1=1;OE2=1;i++;P1=LedChar[cnt1][5];break;
  case 6:a=1;b=1;c=0;OE0=0;OE1=1;OE2=1;i++;P1=LedChar[cnt1][6];break;
  case 7:a=1;b=1;c=1;OE0=0;OE1=1;OE2=1;i++;P1=LedChar[cnt1][7];break;
  case 8:a=0;b=0;c=0;OE0=1;OE1=0;OE2=1;i++;P1=LedChar[6][0];break;
  case 9:a=0;b=0;c=1;OE0=1;OE1=0;OE2=1;i++;P1=LedChar[6][1];break;
  case 10:a=0;b=1;c=0;OE0=1;OE1=0;OE2=1;i++;P1=LedChar[6][2];break;
  case 11:a=0;b=1;c=1;OE0=1;OE1=0;OE2=1;i++;P1=LedChar[6][3];break;
  case 12:a=1;b=0;c=0;OE0=1;OE1=0;OE2=1;i++;P1=LedChar[6][4];break;
  case 13:a=1;b=0;c=1;OE0=1;OE1=0;OE2=1;i++;P1=LedChar[6][5];break;
  case 14:a=1;b=1;c=0;OE0=1;OE1=0;OE2=1;i++;P1=LedChar[6][6];break;
  case 15:a=1;b=1;c=1;OE0=1;OE1=0;OE2=1;i++;P1=LedChar[6][7];break;
  case 16:a=0;b=0;c=0;OE0=1;OE1=1;OE2=1;i++;P1=LedChar[cnt1][0];break;
  case 17:a=0;b=0;c=1;OE0=1;OE1=1;OE2=0;i++;P1=LedChar[cnt1][1];break;
  case 18:a=0;b=1;c=0;OE0=1;OE1=1;OE2=0;i++;P1=LedChar[cnt1][2];break;
  case 19:a=0;b=1;c=1;OE0=1;OE1=1;OE2=0;i++;P1=LedChar[cnt1][3];break;
  case 20:a=1;b=0;c=0;OE0=1;OE1=1;OE2=0;i++;P1=LedChar[cnt1][4];break;
  case 21:a=1;b=0;c=1;OE0=1;OE1=1;OE2=0;i++;P1=LedChar[cnt1][5];break;
  case 22:a=1;b=1;c=0;OE0=1;OE1=1;OE2=0;i++;P1=LedChar[cnt1][6];break;
  case 23:a=1;b=1;c=1;OE0=1;OE1=1;OE2=0;i=0;P1=LedChar[cnt1][7];break;
  default:break;
}
for(d=0;d>50;d++);
tmr++;
if(tmr>=500)
{
  tmr=0;
  cnt1++;
  if(cnt1>=4)
  {
   cnt1=0;
  }
}
}
/*右轉*/
void you()
{
static unsigned char i=0;
P1=0xFF;
switch(i)
{
  case 0:a=0;b=0;c=0;OE0=0;OE1=1;OE2=1;i++;P1=LedChar[5][0];break;
  case 1:a=0;b=0;c=1;OE0=0;OE1=1;OE2=1;i++;P1=LedChar[5][1];break;
  case 2:a=0;b=1;c=0;OE0=0;OE1=1;OE2=1;i++;P1=LedChar[5][2];break;
  case 3:a=0;b=1;c=1;OE0=0;OE1=1;OE2=1;i++;P1=LedChar[5][3];break;
  case 4:a=1;b=0;c=0;OE0=0;OE1=1;OE2=1;i++;P1=LedChar[5][4];break;
  case 5:a=1;b=0;c=1;OE0=0;OE1=1;OE2=1;i++;P1=LedChar[5][5];break;
  case 6:a=1;b=1;c=0;OE0=0;OE1=1;OE2=1;i++;P1=LedChar[5][6];break;
  case 7:a=1;b=1;c=1;OE0=0;OE1=1;OE2=1;i++;P1=LedChar[5][7];break;
  case 8:a=0;b=0;c=0;OE0=1;OE1=0;OE2=1;i++;P1=LedChar[6][0];break;
  case 9:a=0;b=0;c=1;OE0=1;OE1=0;OE2=1;i++;P1=LedChar[6][1];break;
  case 10:a=0;b=1;c=0;OE0=1;OE1=0;OE2=1;i++;P1=LedChar[6][2];break;
  case 11:a=0;b=1;c=1;OE0=1;OE1=0;OE2=1;i++;P1=LedChar[6][3];break;
  case 12:a=1;b=0;c=0;OE0=1;OE1=0;OE2=1;i++;P1=LedChar[6][4];break;
  case 13:a=1;b=0;c=1;OE0=1;OE1=0;OE2=1;i++;P1=LedChar[6][5];break;
  case 14:a=1;b=1;c=0;OE0=1;OE1=0;OE2=1;i++;P1=LedChar[6][6];break;
  case 15:a=1;b=1;c=1;OE0=1;OE1=0;OE2=1;i++;P1=LedChar[6][7];break;
  case 16:a=0;b=0;c=0;OE0=1;OE1=1;OE2=1;i++;P1=LedChar[5][0];break;
  case 17:a=0;b=0;c=1;OE0=1;OE1=1;OE2=0;i++;P1=LedChar[5][1];break;
  case 18:a=0;b=1;c=0;OE0=1;OE1=1;OE2=0;i++;P1=LedChar[5][2];break;
  case 19:a=0;b=1;c=1;OE0=1;OE1=1;OE2=0;i++;P1=LedChar[5][3];break;
  case 20:a=1;b=0;c=0;OE0=1;OE1=1;OE2=0;i++;P1=LedChar[5][4];break;
  case 21:a=1;b=0;c=1;OE0=1;OE1=1;OE2=0;i++;P1=LedChar[5][5];break;
  case 22:a=1;b=1;c=0;OE0=1;OE1=1;OE2=0;i++;P1=LedChar[5][6];break;
  case 23:a=1;b=1;c=1;OE0=1;OE1=1;OE2=0;i=0;P1=LedChar[5][7];break;
  default:break;
}
}
芯片使用的是74h138
只寫了一部分

作者: 世界太小_    時間: 2020-8-11 10:02
兩個點
①驅動電壓不足
②你程序里面刷新的時間太慢了,導致顯示的很暗

作者: 13487086265    時間: 2020-8-11 15:41
刷新太快也有可能
作者: yu1994    時間: 2020-8-11 21:09
世界太小_ 發表于 2020-8-11 10:02
兩個點
①驅動電壓不足
②你程序里面刷新的時間太慢了,導致顯示的很暗

謝謝了
作者: mirror.    時間: 2020-8-12 09:19
電阻減少一點
作者: 梁廷明    時間: 2020-8-12 11:15
刷新頻率過低,用51單片機的時候,刷新頻率給低也是會變暗
作者: ngp123235    時間: 2020-8-12 14:40
頻率太慢了
作者: Roy-2010    時間: 2020-8-12 14:43
要寫調亮度的代碼進去。
作者: qiuge    時間: 2020-8-14 21:19
有源碼和電路圖嗎
作者: qiuge    時間: 2020-8-14 21:24
源碼和電路圖呢




歡迎光臨 (http://www.raoushi.com/bbs/) Powered by Discuz! X3.1