Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Controlling LED using VC++

Controlling LED using VC++

Scheduled Pinned Locked Moved C / C++ / MFC
c++tutorialquestion
13 Posts 7 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Ram Murali
    wrote on last edited by
    #1

    Hi All, Can anyone please suggest me some ideas about how to control LED's using VC++? Thanks in advance.

    Regards, Ram

    C H K M 4 Replies Last reply
    0
    • R Ram Murali

      Hi All, Can anyone please suggest me some ideas about how to control LED's using VC++? Thanks in advance.

      Regards, Ram

      C Offline
      C Offline
      Cedric Moonen
      wrote on last edited by
      #2

      :confused: Which LED ?


      Cédric Moonen Software developer
      Charting control [v1.2 - Updated]

      R T 2 Replies Last reply
      0
      • R Ram Murali

        Hi All, Can anyone please suggest me some ideas about how to control LED's using VC++? Thanks in advance.

        Regards, Ram

        H Offline
        H Offline
        Hamid Taebi
        wrote on last edited by
        #3

        Can you more explain?


        WhiteSky


        1 Reply Last reply
        0
        • C Cedric Moonen

          :confused: Which LED ?


          Cédric Moonen Software developer
          Charting control [v1.2 - Updated]

          R Offline
          R Offline
          Ram Murali
          wrote on last edited by
          #4

          I am trying to design a software to communicate with a LED using serial port to On/Off the LED. so any help regarding this will highly be appreciated.

          Regards, Ram

          C 1 Reply Last reply
          0
          • R Ram Murali

            I am trying to design a software to communicate with a LED using serial port to On/Off the LED. so any help regarding this will highly be appreciated.

            Regards, Ram

            C Offline
            C Offline
            Cedric Moonen
            wrote on last edited by
            #5

            You can't communicate with a LED using the serial port (a LED doesn't 'communicate'). You probably meant that you communicate with some kind of harware (like a microcontroler) that will switch your LED on or off. Well, then just send some specific packet on the link that your microcontroller can recognize. Where are you stuck exactly ? Because it is really vague...


            Cédric Moonen Software developer
            Charting control [v1.2 - Updated]

            R 1 Reply Last reply
            0
            • C Cedric Moonen

              You can't communicate with a LED using the serial port (a LED doesn't 'communicate'). You probably meant that you communicate with some kind of harware (like a microcontroler) that will switch your LED on or off. Well, then just send some specific packet on the link that your microcontroller can recognize. Where are you stuck exactly ? Because it is really vague...


              Cédric Moonen Software developer
              Charting control [v1.2 - Updated]

              R Offline
              R Offline
              Ram Murali
              wrote on last edited by
              #6

              Oooopzzzz. I just started to do some research regarding this to gather some knowledge about controlling LEDs using software. I understood by your answer that i should need some extra hardware(Microcontroller) to control LED. Then I must go and find something about microcontroller and controlling LED first. Anyway thanx a lot for your information. Atleast i got some idea abt this. Do you have any idea about this without microcontroller. ( that means jus with common electronic items such as breadboards, resistors, capacitors and transistors.)

              Regards, Ram

              C J 2 Replies Last reply
              0
              • R Ram Murali

                Oooopzzzz. I just started to do some research regarding this to gather some knowledge about controlling LEDs using software. I understood by your answer that i should need some extra hardware(Microcontroller) to control LED. Then I must go and find something about microcontroller and controlling LED first. Anyway thanx a lot for your information. Atleast i got some idea abt this. Do you have any idea about this without microcontroller. ( that means jus with common electronic items such as breadboards, resistors, capacitors and transistors.)

                Regards, Ram

                C Offline
                C Offline
                Cedric Moonen
                wrote on last edited by
                #7

                Maybe what you could do is use one of the control line of the serial port (like CTS, but you need to check which one you could use) and then connect your LED with a resistor between this line and the ground. But, I don't think this is the most appropriate forum to discuss about that because it is not in fact a programming question...


                Cédric Moonen Software developer
                Charting control [v1.2 - Updated]

                R 1 Reply Last reply
                0
                • R Ram Murali

                  Hi All, Can anyone please suggest me some ideas about how to control LED's using VC++? Thanks in advance.

                  Regards, Ram

                  K Offline
                  K Offline
                  kakan
                  wrote on last edited by
                  #8

                  You can connect LED's to some of the pins of the parallell printer port. You will need to use serial resistors, though. Else, chances are that you will break either the printer driver circuitry (in the computer), or the LEDs themself. You can use inpout32 (search for it) to control the individual pins of the parallell port.

                  Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson

                  1 Reply Last reply
                  0
                  • C Cedric Moonen

                    Maybe what you could do is use one of the control line of the serial port (like CTS, but you need to check which one you could use) and then connect your LED with a resistor between this line and the ground. But, I don't think this is the most appropriate forum to discuss about that because it is not in fact a programming question...


                    Cédric Moonen Software developer
                    Charting control [v1.2 - Updated]

                    R Offline
                    R Offline
                    Ram Murali
                    wrote on last edited by
                    #9

                    K thank you very much for your valuable information. I think your information is more than enough for me. I think i mus go with the microcontroller. Thanks again.

                    Regards, Ram

                    K 1 Reply Last reply
                    0
                    • R Ram Murali

                      K thank you very much for your valuable information. I think your information is more than enough for me. I think i mus go with the microcontroller. Thanks again.

                      Regards, Ram

                      K Offline
                      K Offline
                      kakan
                      wrote on last edited by
                      #10

                      If you can use the parallel printer port instead, see my response.

                      Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson

                      1 Reply Last reply
                      0
                      • C Cedric Moonen

                        :confused: Which LED ?


                        Cédric Moonen Software developer
                        Charting control [v1.2 - Updated]

                        T Offline
                        T Offline
                        toxcct
                        wrote on last edited by
                        #11

                        Cedric Moonen wrote:

                        Which LED ?

                        THE Led :rolleyes:


                        [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

                        1 Reply Last reply
                        0
                        • R Ram Murali

                          Hi All, Can anyone please suggest me some ideas about how to control LED's using VC++? Thanks in advance.

                          Regards, Ram

                          M Offline
                          M Offline
                          Mike ONeill
                          wrote on last edited by
                          #12

                          If you are willing to use the parallel port for driving of the LED, as Kahan has suggested, then here's a good article that might help: "Parallel port interfacing made easy: Simple circuits and programs to show how to use PC parallel port output capabilities" at http://www.epanorama.net/circuits/parallel_output.html[^] Note that under current Windows OSs, the outportb() function is no longer usable, and indeed all functions that directly access the port are not usable. You will need a prot driver, as noted in the cited article. Mike

                          1 Reply Last reply
                          0
                          • R Ram Murali

                            Oooopzzzz. I just started to do some research regarding this to gather some knowledge about controlling LEDs using software. I understood by your answer that i should need some extra hardware(Microcontroller) to control LED. Then I must go and find something about microcontroller and controlling LED first. Anyway thanx a lot for your information. Atleast i got some idea abt this. Do you have any idea about this without microcontroller. ( that means jus with common electronic items such as breadboards, resistors, capacitors and transistors.)

                            Regards, Ram

                            J Offline
                            J Offline
                            Joan M
                            wrote on last edited by
                            #13

                            I believe that you can do it using the parallel port using 24 volts that you should make available from your code in one of the port pins. We have here working something like that but in that case we make an alarm to sound and we have used a relay and some cables, but only the parallel port. If we are capable to make an alarm to sound, I'm sure that you'll be able to enlight a led. Hope this helps.

                            1 Reply Last reply
                            0
                            Reply
                            • Reply as topic
                            Log in to reply
                            • Oldest to Newest
                            • Newest to Oldest
                            • Most Votes


                            • Login

                            • Don't have an account? Register

                            • Login or register to search.
                            • First post
                              Last post
                            0
                            • Categories
                            • Recent
                            • Tags
                            • Popular
                            • World
                            • Users
                            • Groups