Quantcast
Channel: Microcontrollers
Viewing all articles
Browse latest Browse all 4922

CCS C struct problem (Undefined identifier)

$
0
0
Hi! I have developed code for controlling servo motor which worked fine. Then, I tried to make it as header file and c file separately.
Code (C):
  1.  
  2. //this is main.c
  3.  
  4. #include <config.h>
  5. #include "servo_control.h"
  6.  
  7. void main()
  8. {
  9.    struct Servo servo1;
  10.    servo1.servo_attach('D', 0);
  11.    
  12.    while(TRUE)
  13.    {
  14.     servo1.servo_write(45);
  15.    }
  16. }
  17.  
  18. //this is servo_control.h
  19.  
  20. #ifndef SERVO_CONTROL_H
  21. #define    SERVO_CONTROL_H
  22.  
  23. struct Servo
  24. {
  25.     int servo_pin;
  26.     unsigned long CCPR;
  27.     unsigned...
CCS C struct problem (Undefined identifier)

Viewing all articles
Browse latest Browse all 4922

Trending Articles