Click here to Skip to main content
15,890,670 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Change MFC Icon Pin
l a u r e n17-Jan-04 8:58
l a u r e n17-Jan-04 8:58 
GeneralRe: Change MFC Icon -- THANKS! Pin
shultas17-Jan-04 9:14
shultas17-Jan-04 9:14 
GeneralUse the Radio button to control motor speed Pin
Member 64882817-Jan-04 6:44
Member 64882817-Jan-04 6:44 
GeneralRe: Use the Radio button to control motor speed Pin
l a u r e n17-Jan-04 7:52
l a u r e n17-Jan-04 7:52 
GeneralRe: Use the Radio button to control motor speed Pin
Member 64882818-Jan-04 5:02
Member 64882818-Jan-04 5:02 
GeneralRe: Use the Radio button to control motor speed Pin
Roger Wright18-Jan-04 5:54
professionalRoger Wright18-Jan-04 5:54 
GeneralRe: Use the Radio button to control motor speed Pin
Member 64882818-Jan-04 14:59
Member 64882818-Jan-04 14:59 
GeneralRe: Use the Radio button to control motor speed Pin
Roger Wright18-Jan-04 16:05
professionalRoger Wright18-Jan-04 16:05 
A DC motor, unless it is very tiny, draws more current than a parallel port can provide without burning out. DC motors are voltage controlled (not really, but it looks that way to the user), so you need a variable voltage to adjust the speed. An D/A converter takes a digital input and converts it into a dc voltage. An amplifier following it raises the voltage and provides the large current necessary to drive a motor. Crude versions of both are easy to design and build.

If the motor is very tiny you might try one of a couple of approaches. The simplest is to connect it to a line of the parallel port (with a small series resistance to protect the port) then output a pattern of bytes the alternates the ratio of 1's and 0's on the line to simulate a PWM signal. Another method would be to attach series resistances to all the lines, tie them together at the motor connection, then use a binary value to effectively switch resistances in and out of the circuit. Assuming that the parallel port is used to switch a powered motor to ground (line driver circuits can usually sink far more current than they can source), all 0's would create the lowest virtual resistance to ground, while all 1's would be effectively open.

I don't know what a modern port can handle in terms of current - they don't publish specs with PCs anymore. They used to use a TTL open-collector configuration which could sink about 100 mA, max. I doubt that they've increased that, more likely it's less these days.According to my reading of some troubleshooting manuals, the parallel ports are still TTL, a 5V logic family, so the spec is unlikely to have changed much. Note that a logic 1 signal must be applied to the SELECT pin for the port to send any data at all.

For the software to drive it you'll need to do some research. The parallel port uses much of the same stuff as a serial port. See "Using Communications Resources" in the Platform SDK for detailed information. You'll need to write a class for communicating with a parallel port with your motor connected to it, providing a function to change speeds which implements your preferred method of controlling the effective motor voltage, then your control program can call this function in response to a radio button selection. Sounds like fun, if hazardous to your PC - good luck!Big Grin | :-D

"Another day done - All targets met; all systems fully operational; all customers satisfied; all staff keen and well motivated; all pigs fed and ready to fly" - Jennie A.

GeneralInvalid handle Pin
lpRomang16-Jan-04 23:04
lpRomang16-Jan-04 23:04 
GeneralRe: Invalid handle Pin
Monty217-Jan-04 1:07
Monty217-Jan-04 1:07 
GeneralRe: Invalid handle Pin
lpRomang17-Jan-04 2:21
lpRomang17-Jan-04 2:21 
GeneralMenu Pin
Member 80845916-Jan-04 20:51
Member 80845916-Jan-04 20:51 
Generalexporting Win32 Dll to a Vb Client Pin
SiddharthAtw16-Jan-04 20:39
SiddharthAtw16-Jan-04 20:39 
GeneralStore array into buffer Pin
Ivoryping16-Jan-04 20:37
Ivoryping16-Jan-04 20:37 
Generalcode Pin
shanmuk16-Jan-04 19:20
shanmuk16-Jan-04 19:20 
GeneralRe: code Pin
User 665817-Jan-04 0:54
User 665817-Jan-04 0:54 
GeneralQ/A Visual C++ Program Wanted Pin
Michael Hinton16-Jan-04 19:10
Michael Hinton16-Jan-04 19:10 
Generalabout the CompltionPort Pin
maomc197816-Jan-04 18:54
maomc197816-Jan-04 18:54 
GeneralRe: about the CompltionPort Pin
l a u r e n17-Jan-04 7:57
l a u r e n17-Jan-04 7:57 
GeneralRe: about the CompltionPort Pin
maomc197817-Jan-04 15:59
maomc197817-Jan-04 15:59 
GeneralFinding Windows Directory Pin
shultas16-Jan-04 18:27
shultas16-Jan-04 18:27 
GeneralRe: Finding Windows Directory Pin
Garth J Lancaster16-Jan-04 18:56
professionalGarth J Lancaster16-Jan-04 18:56 
GeneralReply #2 ... (hmmm) Pin
Garth J Lancaster16-Jan-04 19:02
professionalGarth J Lancaster16-Jan-04 19:02 
GeneralRe: Finding Windows Directory Pin
Brian D16-Jan-04 21:51
Brian D16-Jan-04 21:51 
GeneralTotal noob question Pin
georgiek5016-Jan-04 14:33
georgiek5016-Jan-04 14:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.