1,105,352 Community Members

Error in c code, Help. pic 16f887

Member Avatar
siqu
Newbie Poster
2 posts since Mar 2012
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

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 .

Member Avatar
WaltP
Posting Sage w/ dash of thyme
9,363 posts since May 2006
Reputation Points: 2,905 [?]
Q&As Helped to Solve: 1,151 [?]
Skill Endorsements: 45 [?]
Team Colleague
 
0
 

Where are _delay_ms and _delay_us defined?

Member Avatar
siqu
Newbie Poster
2 posts since Mar 2012
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Where are _delay_ms and _delay_us defined?

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

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article