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.
CCS C struct problem (Undefined identifier)
Code (C):
- //this is main.c
- #include <config.h>
- #include "servo_control.h"
- void main()
- {
- struct Servo servo1;
- servo1.servo_attach('D', 0);
- while(TRUE)
- {
- servo1.servo_write(45);
- }
- }
- //this is servo_control.h
- #ifndef SERVO_CONTROL_H
- #define SERVO_CONTROL_H
- struct Servo
- {
- int servo_pin;
- unsigned long CCPR;
- unsigned...