We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,466 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Error in c code, Help. pic 16f887

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 .

2
Contributors
2
Replies
16 Minutes
Discussion Span
1 Year Ago
Last Updated
3
Views
siqu
Newbie Poster
2 posts since Mar 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

Where are _delay_ms and _delay_us defined?

WaltP
Posting Sage w/ dash of thyme
Team Colleague
11,404 posts since May 2006
Reputation Points: 3,421
Solved Threads: 1,055
Skill Endorsements: 37

Where are _delay_ms and _delay_us defined?

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

siqu
Newbie Poster
2 posts since Mar 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.0556 seconds using 2.66MB