久久久久久久999_99精品久久精品一区二区爱城_成人欧美一区二区三区在线播放_国产精品日本一区二区不卡视频_国产午夜视频_欧美精品在线观看免费

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

作者: 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.zg4o1577.cn/bbs/) Powered by Discuz! X3.1
主站蜘蛛池模板: 久热免费在线 | 国产a区| 久久久影院| 黄色大片免费观看 | 久久久久中文字幕 | 日韩一二三区视频 | 欧美激情a∨在线视频播放 成人免费共享视频 | 日韩一区二区三区在线视频 | 黄色在线免费观看 | 91国产视频在线观看 | 人人看人人射 | 超碰97免费在线 | 天天操综合网站 | 国产免费av在线 | 日韩一区二区三区在线 | 又黑又粗又长的欧美一区 | 国产视频一区二区在线观看 | 精品乱码一区二区 | 日韩精品一区二区三区在线观看 | 日本午夜一区 | 九九久久精品 | 久久精品国产免费看久久精品 | 国产高清精品在线 | 精品国产久 | 搞黄网站在线观看 | 国产欧美一区二区三区久久 | 欧美精品日韩精品 | 欧美性受xxxx白人性爽 | 亚洲一在线| 在线观看国产视频 | 亚洲激情av| 精品蜜桃一区二区三区 | a视频在线播放 | 亚洲一区二区久久久 | 久久亚洲一区二区三区四区 | 欧美成人一区二免费视频软件 | 亚洲精品乱码久久久久久按摩观 | 欧美精品久久久 | 久久男人 | 亚洲a视频 | 久草在线影 |