Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Putchar() Getchar()

Status
Not open for further replies.

Pheetuz

Full Member level 3
Joined
Feb 12, 2010
Messages
162
Helped
21
Reputation
42
Reaction score
19
Trophy points
1,298
Location
Brighton
Activity points
2,835
I am having a go at teaching myself C, I am using MicroChips IDE and their C18 compiler for this.

I have tried using the putchar() and getchar() command for a very basic program that displays whatever key you press on the keyboard. The program is a program that I know I have run before on codewarrior IDE but it does not seem to want to work on MPLAB.

Is this because a PIC would not have these functions built into them and as such the compiler wont let me use them ??

When I try to compile the program, it says "Cannot use a function without declaring a function prototype". I was under the assumption that the prototype would be in stdio.h ???

Many thanks.

Pete
 

I was under the assumption that the prototype would be in stdio.h ???

maybe you should verify if that assumption is faulty?
 

these function are used to get the character and to display at monitor screen. micro-controller programming is little bit different. what you wanna do???
to get key and display it; first learn how to interface lcd and keypad with micro-controller, then write the code. putchar() and getchar() does not work in micro-controller programming. {although you have built-in library functions like lcd_out() and get_press_key() in mikroc.}
 

Ahhh, thanks ... Yeah i thought that might be the case, not realy that bothered about the putchar and getchar commands as such, just learning from a book and was worried that the book might be erronious.

Will have a look at getting another IDE / compiler thats not designed for a microprocessor and have another ***** at it.

Cheers guys.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top