![]() | ![]() | ![]() |
| | |||||||
| 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? |
| | LinkBack | Thread Tools | Display Modes |
| | (permalink) |
| 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. | |
| |
| | (permalink) |
| please help!!! no one knows :-0 | |
| |
| | (permalink) |
| 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 | |
| |
| | (permalink) |
| 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) } | |
| |
| | (permalink) |
| error is declaration terminated incorrectly at starting of braces " { " | |
| |
| | (permalink) |
| 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. | |
| |
| | (permalink) |
| 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 | |
| |
| | (permalink) |
| 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. | |
| |
| | (permalink) |
| 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. | |
| |
| | (permalink) |
| also, why define `port` (#define port 0x378), if you're not gonna use it...e.g., outportb(port, 0x7c) | |
| |
| | (permalink) |
| Can you post the schematics of your circuit that you connect to the parallel port ? | |
| |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |
| | ||||
| Title | Starter | Forum | Replies | Latest |
| anybody familier with nigels tutorials? | kutalinelucas | Micro Controllers | 9 | 10th March 2008 02:40 AM |