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
 
Tools
Old 17th September 2005, 03:47 PM   #31
Default

Quote:
Originally Posted by Styx
I'm not sure how to do it under windows BUT if I have a program like this

#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int main(void)
{
printf("%f",sin(0.8))
return 0
}



now if I compile this with

gcc test.c it will fail since I have not linked the maths libary (in Linux this is libmath.so)

So I need to do

gcc test.c -lmath

to link the maths libary (linux equiv of a DLL) into this program

YOu are going to have to do the same in windows...
Exactly. Like I said, basic compiler/linker concept.
__________________
Time is nature\'s way of keeping everything from happening at once.
http://membres.lycos.fr/jrainville/
Joel Rainville is offline  
Old 18th September 2005, 08:38 AM   #32
Default

ok, so I tried a much simpler code, a blinking led code, it compiled, built and linked successfully, but nothing happened to my circuit. What could be wrong? I already extracted the inpout32.dll in the lib folder of VC++, in the system32 and system folder of C:\, but it still doesn't work. below are the attachments of what I did
Attached Thumbnails
inpout.dll and Visual C++-1_264.gif   inpout.dll and Visual C++-3_733.jpg   inpout.dll and Visual C++-2_819.gif  
gastonanthony is offline  
Old 18th September 2005, 11:39 AM   #33
Default

Good, you're almost there

Now, you need to send a bit more data if you want to see something happen. Try something like that :

Code:
int i, j;
for( i = 0; i < 10; i++ )
{
	for( j = 0; j < 2500; j++ )
	{
		Out32(...); // Send '1'
	}
	for( j = 0; j < 2500; j++ )
	{
		Out32(...); // Send '0'
	}
}
If everything's fine, you should see your LED blink 10 times before your program quits.
__________________
Time is nature\'s way of keeping everything from happening at once.
http://membres.lycos.fr/jrainville/
Joel Rainville is offline  
Old 18th September 2005, 02:39 PM   #34
Default

hahahahaha :lol: :lol: :lol:
thanks a lot to all of you guys especially to you Joel Rainville, I used the for loop that you made, i just saw one blink at first, then I changed the number of loops of 1s and 0s to 10000, and it worked perfectly!!! :lol: :lol:
just a question, do you guys know the equivalent microsecond or nanosecond of the execution of a line of instruction in visual C++?I may be needing it for servomotor control to be able to continue my robotic project
gastonanthony is offline  
Old 18th September 2005, 02:48 PM   #35
Default

Quote:
Originally Posted by gastonanthony
just a question, do you guys know the equivalent microsecond or nanosecond of the execution of a line of instruction in visual C++?I may be needing it for servomotor control to be able to continue my robotic project
I don't think there is one?, and the mS timing isn't particularly accurate either under Windows - unless you take over the OS priorities. You should also be aware that port access is relatively slow, if you look at the links posted earlier about how port access occurs under Win32 you'll see why!.

If you want to feed servos, use a PIC to feed them, and control them via the RS232 port - PIC systems for this are commonly available.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Old 19th September 2005, 01:59 AM   #36
Default

Quote:
Originally Posted by gastonanthony
hahahahaha :lol: :lol: :lol:
thanks a lot to all of you guys especially to you Joel Rainville, I used the for loop that you made, i just saw one blink at first, then I changed the number of loops of 1s and 0s to 10000, and it worked perfectly!!! :lol: :lol:
just a question, do you guys know the equivalent microsecond or nanosecond of the execution of a line of instruction in visual C++?I may be needing it for servomotor control to be able to continue my robotic project
Well, C++ is a powerful language, simply add delay codes to it and you will get wat you want. Most probably the speed is determine by your processing power from your cpu. It should be able to handle microsecond with just a PIII.
__________________
InfinityCreation - Where creations goes to infinity!
ym2k is offline  
Old 19th September 2005, 02:36 AM   #37
Default

Quote:
Originally Posted by ym2k
Quote:
Originally Posted by gastonanthony
hahahahaha :lol: :lol: :lol:
thanks a lot to all of you guys especially to you Joel Rainville, I used the for loop that you made, i just saw one blink at first, then I changed the number of loops of 1s and 0s to 10000, and it worked perfectly!!! :lol: :lol:
just a question, do you guys know the equivalent microsecond or nanosecond of the execution of a line of instruction in visual C++?I may be needing it for servomotor control to be able to continue my robotic project
Well, C++ is a powerful language, simply add delay codes to it and you will get wat you want. Most probably the speed is determine by your processing power from your cpu. It should be able to handle microsecond with just a PIII.
But it won't be reliable at all, and it has nothing to do with the language. Nigel's post just before yours gives a good reason why...
__________________
Time is nature\'s way of keeping everything from happening at once.
http://membres.lycos.fr/jrainville/
Joel Rainville is offline  
Old 4th April 2006, 10:22 PM   #38
Default about blinking

Can some one tell me how to make my LED to blink 2,4,5, or more times...I tried how you had write but it just blink one time and thats all....Please ..
Sk1peR is offline  
Old 29th May 2009, 06:42 PM   #39
Default

Hi friends the orginal questionPosted by gastonanthony is also my question,I've read alot on different forums but I can not get clear view,the problem I want toaddress is interfacing a switching module using VC++ in Win XP platform
degarege is offline  
Old 29th May 2009, 06:52 PM   #40
Default

to unlock the parallel port many people suggested me to use inpout.dll. I've downloaded it but how can I use it.can I include in my applications source code or in c:\ at the drivers.It is a little bit difficult for me.
degarege is offline  
Old 29th May 2009, 07:18 PM   #41
Default

inpout.dll has to be imported into your compiler and you have to use IT'S functions to setup and drive the port. What you need to do is setup a program called giveio which works for every program on the system.
__________________
"Because I be what I be. I would tell you what you want to know if I
could, mum, but I be a cat, and no cat anywhere ever gave anyone a
straight answer, har har."
Sceadwian is offline  
Old 29th May 2009, 07:31 PM   #42
Default

thank U Sceadawian for u'r responce but simply importing it my compiler and coding does the required function what I'm in need of,would u like to clarify for me
degarege is offline  
Old 29th May 2009, 07:39 PM   #43
Default

Sorry I can't, I'm not too familiar with the tools myself. I know you can import DLL's that have published functions. Many DLL's are compiled with the functions published in a sort of descriptor, never used the feature and it's been a long time since I tried to code anything serious. You need information on how to use the published functions though.
__________________
"Because I be what I be. I would tell you what you want to know if I
could, mum, but I be a cat, and no cat anywhere ever gave anyone a
straight answer, har har."
Sceadwian is offline  
Reply

Tags
inpoutdll, visual

Thread Tools
Display Modes




All times are GMT. The time now is 11:22 PM.


Electronic Circuits  |  Learning Electronics
eXTReMe Tracker