erfan.khalilian69
Member level 4
- Joined
- Feb 7, 2011
- Messages
- 71
- Helped
- 3
- Reputation
- 6
- Reaction score
- 3
- Trophy points
- 1,288
- Location
- Kualalampur
- Activity points
- 1,916
#ifndef _CONFIG_H_
#define _CONFIG_H_
/* HTC.H Required Defines */
#define _XTAL_FREQ 4000000 //4MHz OSC
#endif
#include "config.h"
#include <htc.h>
void main (void)
{
PORTB = 0x00;
TRISB = 0x00;
while(1)
{
PORTB = 0x00;
__delay_ms(1000); // delay for 1 second
PORTB = 0xFF;
__delay_ms(1000); // delay for 1 second
}
}
__delay_ms(1.5); // delay for 2 milliseconds
CLRWDT();
PORTB = 0x00;
__delay_ms(18.5); // delay for 2 milliseconds
CLRWDT();
Warning [356] E:\study\level 4\MechatronicDesign\MainProgram\Source Code\PR11.c; 136.28 implicit conversion of float to integer
Warning [361] E:\study\level 4\MechatronicDesign\MainProgram\Source Code\PR11.c; 399.1 function declared implicit int
#include<pic.h>
#include <htc.h>
#ifndef _XTAL_FREQ
// Unless already defined assume 4MHz system frequency
// This definition is required to calibrate __delay_us() and __delay_ms()
#define _XTAL_FREQ 20000000
#endif
#include "config.h"
#include <htc.h>
this program must be able to rotate servo motor clockwise and after some delay then rotate in CCW (initial position), if you have any advice it will be great .
thanks
What PIC model are you using?
---------- Post added at 08:00 ---------- Previous post was at 07:58 ----------
Never mind, PIC16f877a I didn't see it in the title. My project was compiled for the PIC16f877a as well.
I got it! I fix the file not found error and now I'm working on float to integer conversions. You need to copy the config.h into the source directory you have and then tell the compiler where to find it.
Do you want to round temperature up to the nearest whole number? In other words 78.567 degrees becomes 79 degrees?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?