ควบคุมเซอร์โวหลายช่องด้วย Timer และ CCP (PIC CCS)

Started by ozuke, February 13, 2013, 09:29:36 PM

Previous topic - Next topic

ozuke

Quote from: mikekk on April 10, 2013, 06:11:55 PM
ใช้ความถี่ 20MHzครับ เปลี่ยนเบอร์เป็น16f887แต่คอมไพลไม่ได้ครับ
แต่ถ้าลบvolatileใน
typedef struct tServo{
   volatile unsigned pin;
   volatile unsigned Active;
   volatile unsigned int16 value;
}
ออกจะคอมไพลได้ แต่ลองโปรแกรมในproteus ไม่ได้อ่ะครับ

ลองแล้วครับได้ตามปกติเลย

mikekk

อ่อ ผมใช้คนละโปรแกรม เดียวลองโหลดโปรแกรมใหม่ก่อนครับ
ขอบคุณครับ

bird techstep

Make it Simple But it Work


mikekk


ozuke

ผมใช้ ccs compile ครับแต่ใช้ mplab เป็น ide ครับเพราะ debug ได้โปรแกรมได้ในตัว มันสะดวกดีครับ :D

mikekk


ozuke


mikekk

Executing: "C:\Program Files (x86)\PICC\Ccsc.exe" +FM "Untitled.c" #__DEBUG=1 +ICD +DF +LN +T +A +M +Z +Y=9 +EA  #__16F887=TRUE
*** Error 34 "Untitled.c" Line 18(1,9): Unknown type
*** Error 43 "Untitled.c" Line 21(1,2): Expecting a declaration
*** Error 48 "Untitled.c" Line 21(2,7): Expecting a (
*** Error 48 "Untitled.c" Line 30(7,12): Expecting a (
*** Error 43 "Untitled.c" Line 30(13,14): Expecting a declaration
*** Error 43 "Untitled.c" Line 30(23,24): Expecting a declaration
*** Error 43 "Untitled.c" Line 30(23,24): Expecting a declaration
*** Error 43 "Untitled.c" Line 30(24,25): Expecting a declaration
*** Error 12 "Untitled.c" Line 41(4,10): Undefined identifier   nServo
*** Error 12 "Untitled.c" Line 48(22,28): Undefined identifier   nServo
*** Error 12 "Untitled.c" Line 50(4,10): Undefined identifier   nServo
*** Error 12 "Untitled.c" Line 68(1,7): Undefined identifier   nServo
*** Error 12 "Untitled.c" Line 69(1,7): Undefined identifier   nServo
*** Error 12 "Untitled.c" Line 70(1,7): Undefined identifier   nServo
*** Error 12 "Untitled.c" Line 88(1,7): Undefined identifier   nServo
      15 Errors,  0 Warnings.
Halting build on first failure as requested.
BUILD FAILED: Thu Apr 11 16:39:15 2013


อันนี้เป็นของ mplab ครับ