Start New Discussion within our Software Development Community

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
//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);
//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);


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?

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

This article has been dead for over six months. Start a new discussion instead.