• slider image 442
  • slider image 483
  • slider image 484
  • slider image 485
  • slider image 486
  • slider image 487
:::


Browsing this Thread:   1 Anonymous Users






Re: 下列七段顯示器程式如何修改
#4
版主
版主


查看用戶資訊
Hex to BCD 的轉換在 W401 C18 的教材裡有 範例 4-1
也可以參考 itoa( ) 的標準函數。

發表於: 2008/2/20 14:49
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 下列七段顯示器程式如何修改
#3
初級會員
初級會員


查看用戶資訊
謝謝這位大大
感謝你的提示,我試試看你的方法

發表於: 2008/2/19 20:01
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 下列七段顯示器程式如何修改
#2
版主
版主


查看用戶資訊
提示一下,0~99 的計數採用16進制的方式倒數,要顯示時須轉成10進制的值後再去7-Segment 查表後顯示0~9的數字,這是比較正確的作法。我在你的程式裡裡沒看到 Hex to BCD 的轉換?
當然你也可以先從個位數的9到0後,在將十位數的值減一;布過這種作法彈性很小就只固定這種功能而已。

發表於: 2008/2/18 9:09
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


下列七段顯示器程式如何修改
#1
初級會員
初級會員


查看用戶資訊
請問各位大大,我想做0~99倒數,下列程式如何修改
while(1)
       {
      
seq(s);
    
seq1(i);
      
seq2(j);
           }        
          
    
  }


  
void seq(char data)
     {
        for(
s=0;s<=0;s++)
         {
           
LATD=0xffff;
           
LATB=LEDTable[s];
           
delay(5000);
           
        
          }
         
      }

 
void seq1(char data)
  {
           
        for(
i=0;i<=9;i++)
         {
             
                
LATD=0xfff1;
                
LATB=LEDTable[i];
                
delay(1000);
               
                       
         }     
    
   }
 
  
void seq2(char data)
  {
         
        for(
j=0;j<=9;j++)
            {
              
              
LATD=0xfff2;
              
LATB=LEDTable[j]; 
              
delay(2000);
     
             }
   }

發表於: 2008/2/16 13:39
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部







You can view topic.
不可以 發起新主題
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.
You cannot create PDF files.
You cannot get print page.

[進階搜尋]


:::

Microchip連結

https://www.facebook.com/microchiptechnologytaiwan/
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=13
https://mu.microchip.com/page/tmu
http://elearning.microchip.com.tw/modules/tad_link/index.php?cate_sn=1
https://page.microchip.com/APAC-PrefCenters-TW.html
http://www.microchip.com/
http://www.microchip.com/treelink
http://www.microchipdirect.com/
http://www.microchip.com.cn/newcommunity/index.php?m=Video&a=index&id=103
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=2
http://www.microchip.com.tw/Data_CD/eLearning/index.html
http://www.microchip.com.tw/RTC/RTC_DVD/
https://www.microchip.com/development-tools/
https://www.youtube.com/user/MicrochipTechnology
[ more... ]

教育訓練中心

!開發工具購買
辦法說明 [業界客戶] [教育單位]
----------------------------------
!校園樣品申請
辦法說明 [教師資格] [學生資格]
----------------------------------