Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Forums > General Electronics Chat


General Electronics Chat This forum is for general chat about electronics, eg: Dont know what a part does? Dont know how to read a circuit? Want to get an opinion?

Reply
 
LinkBack Thread Tools Display Modes
Old 10th April 2008, 02:13 PM   (permalink)
Exclamation anyone is familier from....

hey,
m interfacing my hardware with the help of c language..
so i m having problem with c language code.
does anybody tell me bout it!
the error is..
"declaration is incorrectly"
at the starting braces " { "
please anyone of u who knows how to work in c langauge..help me out!!


Rohaan.
rohaan is offline  
Old 10th April 2008, 03:07 PM   (permalink)
Default

please help!!!
no one knows :-0
rohaan is offline  
Old 10th April 2008, 03:49 PM   (permalink)
Default

Post your code please, makes it easier.
Kind of like me saying "my car doesn't start", and you saying perhaps I'm out of gas, only for me to say, but my car is an electric car...etc
Norlin is offline  
Old 10th April 2008, 04:26 PM   (permalink)
Default

the code is..
#include <conio.h>
#include <stdio.h>
#define port 0*378
{ (here the error occur..incorrectly some thing :S)
outportb (0*378,0*7 c)
delay(1000);
outportb(0*378,0 *c 6)
}
rohaan is offline  
Old 10th April 2008, 04:31 PM   (permalink)
Default

error is
declaration terminated incorrectly
at starting of braces " { "
rohaan is offline  
Old 10th April 2008, 06:12 PM   (permalink)
Default

1. you have to add the line

int main()

before the {

2. replace all * with x i.e. 0x instead of 0*

3. there should not be a space in 0x7c or 0xc6

4. I hope you know this program will work only in DOS (maybe also windows 95/98) Windows 2000/XP prevents direct access to hardware like your parallel port.
petrv is offline  
Old 10th April 2008, 07:14 PM   (permalink)
Default

hey!
Petrv
thanks for explaing
yeah now my c code is running..
but could u pls tell me that if i want to check whether interfacing is working by led to the centronic connector so should i have to connect any external dc supply..if yes so how many volts..
please help me out :S

Rohaan
rohaan is offline  
Old 11th April 2008, 06:56 AM   (permalink)
Default

No need for a power supply. just connect a led with a resistor (for example a red LED and 330 ohm resistor in series). Connect the cathode of the LED to one of the ground pins on the parallel port connector and the anode to the resistor. The other end of the resistor connect to the pin of the port you want to test.
If there is '1' on the pin the LED should emit light.
Petr

Last edited by petrv; 11th April 2008 at 07:01 AM.
petrv is offline  
Old 12th April 2008, 05:10 PM   (permalink)
Default

hey petrv,,
can u please tell me the problem which i am facing with interfacing..
actually my project is to glow value on 7segment display, as u have seen the c langauge code.
but the problem is m not reciving the true value (which i am giving in code)on 7 seg display.
as i gave "c7 "=" 83" but it didnt glow 83,rather glowing some thing garbage..
although my seven segments leds are working..
so hwat to do..
further more when i touched the cables through the data is coming to the hardware,it gives effect to the 7 seg display(changes)..
is it loose conection..????

help me out please..

Rohaan.

Last edited by rohaan; 12th April 2008 at 05:43 PM.
rohaan is offline  
Old 13th April 2008, 06:59 PM   (permalink)
Default

also, why define `port` (#define port 0x378), if you're not gonna use it...e.g., outportb(port, 0x7c)
radiodude is offline  
Old 13th April 2008, 08:26 PM   (permalink)
Default

Can you post the schematics of your circuit that you connect to the parallel port ?
petrv is offline  
Reply

Bookmarks

Thread Tools
Display Modes



Similar Threads
Title Starter Forum Replies Latest
anybody familier with nigels tutorials? kutalinelucas Micro Controllers 9 10th March 2008 02:40 AM



All times are GMT. The time now is 06:51 AM.


Electronic Circuits  |  Learning Electronics
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.

eXTReMe Tracker