Hi all.

I have this error and i cant figure out what is wrong here, i have tried to google and used a few methodes to c what is wrong but, naah, no luck.

pic 16f887
HI-TECH C Compiler for PIC10/12/16 MCUs (Lite Mode) V9.81
Copyright (C) 2010 Microchip Technology Inc.
(1273) Omniscient Code Generation not available in Lite mode (warning)
Error [500] ; 0. undefined symbols:
__delay_ms(servotest4.obj) __delay_us(servotest4.obj)


This is my code :

#include <pic.h>
#include <stdlib.h>
#include <time.h>
#include <stdio.h>



void main(){
int i;


ANSEL  = 0;          // Configure AN pins as digital I/O
ANSELH = 0;
PORTD=0b00000000;
TRISD=0b00000000;
while(1){
//Move Anti Clockwise direction
for(i=1;i<=500; i++){
PORTD=(1<<RB2); //output_high(PIN_B2);
_delay_us(1000); //want servo to move to 0 degrees.
PORTD=(0<<RB2);  //output_low(PIN_B2);
_delay_ms(20);
}
//Move Clockwise Direction
for(i=1;i<=500; i++){
PORTD=(1<<RB2); //output_high(PIN_B2);
_delay_us(2000); //want servo to move to 180 degrees.
PORTD=(0<<RB2);  //output_low(PIN_B2);
_delay_ms(20);
}
}
}

ERROR MESSAGE:

Warning [361] C:\Users\z1\Desktop\securaty drawer\servo code\servo4.c; 20.1 function declared implicit int
Warning [361] C:\Users\z1\Desktop\securaty drawer\servo code\servo4.c; 22.1 function declared implicit int


Than You .

Where are _delay_ms and _delay_us defined?

commented: 1 +0

Where are _delay_ms and _delay_us defined?

OMG!!!!! Dude im so tierd today. Than you for help.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.