【郭天祥 TX-1C经典版 51单片机开发板试用体验】+数码管

  • wambob
  • LV4工程师
  • |      2017-09-15 14:53:18
  • 浏览量 1245
  • 回复:0
本帖最后由 wambob 于 2017-9-15 14:59 编辑 从电子台秤上拆下的数码管显示不件,上面有个驱动器件WCH423,资料自己查,网上也有51的测试源码。 正好用来测试下。这个集成IC是I2C接口,只需4根线。 测试,共阴数码管,每个段为1时,点亮:
void main( void )

{

    mDelaymS( 80 );

   

    CH423_Write( 0x4800 | 0x17 );//启用数码管自动扫描功能



        //16位数码管显示 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F...

        

   

    while(1)

        {

                 

          for(i=0;i<28;i++)

          {

          

         CH423_Write( (0x6000) | BCD_decode_tab ); 

         CH423_Write( (0x6200) | BCD_decode_tab ); 

         CH423_Write( (0x6400) | BCD_decode_tab ); 

         CH423_Write( (0x6600) | BCD_decode_tab ); 

         CH423_Write( (0x6800) | BCD_decode_tab ); 

         CH423_Write( (0x6A00) | BCD_decode_tab ); 

         CH423_Write( (0x6C00) | BCD_decode_tab ); 

         CH423_Write( (0x6E00) | BCD_decode_tab ); 

         CH423_Write( (0x7000) | BCD_decode_tab ); 

         CH423_Write( (0x7200) | BCD_decode_tab ); 

         CH423_Write( (0x7400) | BCD_decode_tab ); 

         CH423_Write( (0x7600) | BCD_decode_tab ); 

         CH423_Write( (0x7800) | BCD_decode_tab ); 

         CH423_Write( (0x7A00) | BCD_decode_tab ); 

         CH423_Write( (0x7C00) | BCD_decode_tab );  

         CH423_Write( (0x7E00) | BCD_decode_tab );

         mDelaymS( 500 );



                  

         }

}
  • 0
  • 收藏
  • 举报
  • 分享
我来回复

登录后可评论,请 登录注册

所有回答 数量:0
x
收藏成功!点击 我的收藏 查看收藏的全部帖子