473,772 Members | 3,752 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

cOde for LEDs using parallel ports

2 New Member
Hi everyone. Hope you guys can help me. Attached below are VB6 codes for a hand phone to call to a modem. When the action is executed, a message box will pop out ‘Ring Ring’. I just want to know is there anyone out there have the codes for SMS where when the action is executed, a message box will pop out.

On the other hand, I also need some simple codes (VB6) for 8 LEDs lights for parallel ports.

[B<u>]Below is the coding for the calling with the MsgBox"Ring Ring" [/b]</u>

Private Sub Form_Load()
' Buffer to hold input string
Dim Instring As String
' Use COM1.
MSComm1.CommPor t = 1
' 9600 baud, no parity, 8 data, and 1 stop bit.
MSComm1.Setting s = "9600,N,8,1 "
' Tell the control to read entire buffer when Input
' is used.
MSComm1.InputLe n = 0
' Open the port.
MSComm1.PortOpe n = True

' Send the attention command to the modem.
'MSComm1.Output = "AT" + Chr$(13)
' Wait for data to come back to the serial port.

Do
DoEvents
Loop Until MSComm1.InBuffe rCount >= 2
' Read the "OK" response data in the serial port.
Instring = MSComm1.Input
' Close the serial port.
MSComm1.PortOpe n = False

End Sub

Private Sub MsComm1_OnComm( )

Select Case MSComm1.CommEve nt
Case comEvRing 'Value 6
MsgBox "Ring Ring"
Case Else
MsgBox "Don't know what event."
End Select
End Sub

Private Sub Form_a()
MSComm1.PortOpe n = False
End Sub
Nov 9 '06 #1
1 3036
sashi
1,754 Recognized Expert Top Contributor
Hi everyone. Hope you guys can help me. Attached below are VB6 codes for a hand phone to call to a modem. When the action is executed, a message box will pop out ‘Ring Ring’. I just want to know is there anyone out there have the codes for SMS where when the action is executed, a message box will pop out.

On the other hand, I also need some simple codes (VB6) for 8 LEDs lights for parallel ports.

[B<u>]Below is the coding for the calling with the MsgBox"Ring Ring" [/b]</u>

Private Sub Form_Load()
' Buffer to hold input string
Dim Instring As String
' Use COM1.
MSComm1.CommPor t = 1
' 9600 baud, no parity, 8 data, and 1 stop bit.
MSComm1.Setting s = "9600,N,8,1 "
' Tell the control to read entire buffer when Input
' is used.
MSComm1.InputLe n = 0
' Open the port.
MSComm1.PortOpe n = True

' Send the attention command to the modem.
'MSComm1.Output = "AT" + Chr$(13)
' Wait for data to come back to the serial port.

Do
DoEvents
Loop Until MSComm1.InBuffe rCount >= 2
' Read the "OK" response data in the serial port.
Instring = MSComm1.Input
' Close the serial port.
MSComm1.PortOpe n = False

End Sub

Private Sub MsComm1_OnComm( )

Select Case MSComm1.CommEve nt
Case comEvRing 'Value 6
MsgBox "Ring Ring"
Case Else
MsgBox "Don't know what event."
End Select
End Sub

Private Sub Form_a()
MSComm1.PortOpe n = False
End Sub
Hi there,

I think am able to help you on the parallel port curcuit, it's also know as parallel port relay curcuit, run a simple search on google.com. Good luck & take care.
Nov 9 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
7063
by: Joseph Suprenant | last post by:
I am looking to read a byte or write a byte on the parallel port in linux. I am using red hat 7.3. I tired using this but i couldnt get anywere. { unsigned char value; __asm__ volatile ("inb %1,%0" : "=a" (value) : "d" ((unsigned short)port)); return value; } */
21
2994
by: The Man With The Harmonica | last post by:
Hi All, What kind of commands can I use to control the serial and parallel port of my pc. I want to use my laptop instead of microcontrollers and write my software in ANSI C to be used for control purposes of sensors and other electronic devices. I haven't done any C for a while now so I would assume my knowledge is that of a beginner now.
11
3329
by: karan | last post by:
I would like to know how one can use the parallel port through c/c++.Also, how does one determine what port is installed(EPP/ECP/SSP/PS2)? What is the differnece between these? What are the current sinking/drawing capacities of these ports? If possible, please give examples in C/C++. Thanks I would be grateful if any ebooks/tutorials could be provided at karanmalhotra85@yahoo.com
6
10938
by: agnivesh | last post by:
Hi there, I'm a beginner in C programming and want to learn how to write C (pure C) code to access hardware ports (serial,parallel,usb etc.) under windows environment ? 1. Please, suggest any online tutorials or free ebooks etc. for that. 2. Is it possible to do above tasks using MingW Developer Studio, GTK+ etc. ? I've just downloaded these tools and want to make sure before
11
5283
by: Timothy Smith | last post by:
hello people. i've been trying to send an 8 byte string to my parallel port under freebsd. the purpose is it to control a relay board. the board simply responds to the output byte coming from the port. eg. 00000001 will set pin 1 high and flick the relay open. todate i've attempted this with merely open() on /dev/ppi0 and numpy for the byte array, but i just can't seem to get it working. i know the parallel port works and i know the...
4
3393
by: Chris Lasher | last post by:
Is there a way to interact with keyboard LEDs (for Caps/Scroll/Num Lock) in Python? I'd like to achieve an effect similar to the *NIX command "setleds -L", but I'm not sure where to start, but I figured someone out there would have an idea or maybe experience with something similar. Thanks very much in advance for your help! Chris
1
1709
by: luco | last post by:
Hello! In my application I need to detect how many parallel ports there are in a machine I'm using and what their state is. Is it possible in C#? Any ideas how to do it? thanks in advance, Lukasz
4
2617
by: bluesteel | last post by:
Hi, guys. I am currently trying to develop a program made under c++ that could control a robot, i mean movement. I thought of using computer ports like serial or parallel which is not a bad idea. That's the first question: How to read and give output to serial and parallel ports. Then, and if the previous is not a good choice, i would like to know how to use a wireless technology.In this area I HAVE NO IDEA HOW IT WORKS, so please tell me...
4
4263
by: jmarcrum | last post by:
I have to modify this assembly code in order to make it use interrupts. Right now, when I push button 1 on the microprocessor the count increments once (the LED's count in binary, using only 3 LED's and only counting to 7 in binary). The second button on the microprocessor, when pushed, resets the count. I have the addreses for both button in the code. However, my trouble is modifying this code. I HAVE to use interrupts. I need a lot...
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10261
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10104
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9912
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8934
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6715
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2850
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.