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


Browsing this Thread:   1 Anonymous Users






Re: 寫的一個程式,幫忙看下能實現他的功能不
#8
新會員
新會員


查看用戶資訊
已經OK了

發表於: 2009/9/25 12:44
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 寫的一個程式,幫忙看下能實現他的功能不
#7
中級會員
中級會員


查看用戶資訊
你的電路圖要不要也上傳上來看看?

發表於: 2009/9/23 13:12
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 寫的一個程式,幫忙看下能實現他的功能不
#6
資深會員
資深會員


查看用戶資訊
既然已經用ICD跑過了

那,是執行到哪行程式的結果非你預期呢?

發表於: 2009/9/22 20:03
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 寫的一個程式,幫忙看下能實現他的功能不
#5
新會員
新會員


查看用戶資訊
是用ICD2跑過,可是沒反應,自己調不出來才問你們的。。。

發表於: 2009/9/22 13:17
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 寫的一個程式,幫忙看下能實現他的功能不
#4
資深會員
資深會員


查看用戶資訊
while(1){
//4ms 執行一次
    
if(sw_on==1){
        if(
sw_count<8){    //4ms *8 =32ms debounce
            
sw_count++;
            if(
sw_count>=8){    
                if(
led==1)    led=0;
                else        
led=1;
            }
        }
    }else{
        
sw_count=0;
    }
}

發表於: 2009/9/18 3:42
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 寫的一個程式,幫忙看下能實現他的功能不
#3
版主
版主


查看用戶資訊
陷入初學著的迷惘。第一程式寫完後,自己不除錯找問題的話這樣功力是不會進步的。建議你用 ICD 跑一下你的程式就知道邏輯架構及程式是否正確,如沒 ICD 也可以使用 MPLAB SIM 來看結果。
第二按鍵輸入沒有處理彈瑱問題,你知道按一次案件跟放開會產生多少脈衝進去嗎? 雖然你有 delay 20mS 但還是補好的處理方式

發表於: 2009/9/17 10:21
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 寫的一個程式,幫忙看下能實現他的功能不
#2
資深會員
資深會員


查看用戶資訊
不能自己用ICD2 跑看看嗎

發表於: 2009/9/17 9:28
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


寫的一個程式,幫忙看下能實現他的功能不
#1
新會員
新會員


查看用戶資訊
char a;
void main()
{
while(
1)
   {
      if (
input(PIN_B0));   
      {
         
delay_ms(20);     
         if (
input(PIN_B0));    
         
a=a++;                 
         if(
a>1)              
            {        
               
a=0;              
            } 
         if(
a>0)               
            {
               
output_high(PIN_C1);  
            }
         else  if(
a=0);   
            { 
               
output_low(PIN_C1);  
            }
      }
   }

}


用B0按鍵控制C1的LED燈亮滅,按一次亮,再按一次滅掉,是用 ccs寫的,誰能幫忙看一下,謝謝!

發表於: 2009/9/17 8:09

Edited by Ryang on 2009年09月17日 10:11:44
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... ]

教育訓練中心

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