My blog has moved!

You will be automatically redirected to the new address. If that does not occur, visit
http://ashokbasnet.com.np
and update your bookmarks.

Showing posts with label VB. Show all posts
Showing posts with label VB. Show all posts

Thursday, December 16, 2010

PC Based Home Automation using VB

The project was done at Thapathali Campus for the V.S. Niketan Exhibition.

The project is based on the concept of controlling the different devices at home using the PC. The parallel port of computer was used as an interface for hardware connection using Computer.

Basic Interface of Software:-

PCInterfaceFig:- Basic Interface of Home automation using VB

Downloads:-

1. PC Based Home Automation software

Wednesday, December 30, 2009

CD Control Application Using VB 6

Controlling the CD/DVD Drive of our computer using an application software is good for both the life of CD/DVD Drive and for us also.
Visual Basic cab be the most easy way to do it.

All you have to do is make a new project.
Add a form and a module and design the interface as you like for eject and close command button.
Name the command Box names as cmdclose and cmdopen for Close and Open Command button.
Private Sub cmdclose_Click()
'Close CD drive door
retvalue = mciSendString("set CDAudio door closed", returnstring, 127, 0)
End Sub

Private Sub cmdopen_Click()
'Open CD drive door
retvalue = mciSendString("set CDAudio door open", returnstring, 127, 0)
End Sub
And now for module section, just copy and paste the following code or the code can be copied from the API.
Public Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long


You can download the exe  file here.