Maker Pro
Visual Basic + Proton Basic + Proteus

Visual Basic + Proton Basic + Proteus

Home Automation with Visual Basic, Proton Basic & Proteus

brian22

Jul 19, 2013
40
Joined
Jul 19, 2013
Messages
40
brian22 submitted a new Showcase Item:

Visual Basic + Proton Basic + Proteus


Proton Basic Code
Code:
Device=16F628A
Xtal=20
All_Digital true
Hserial_Baud 9600 ' Setting Baud rate

TXSTA.5=1 ' setting Transmit Enable Bit
RCSTA.7=1
RCSTA.4=1
RX VAR PORTB.1
TX VAR PORTB.2


  '--------------------------------------------'
'Ports for LED indicator if they are ON/OFF
Output PORTA.0
Output PORTA.1
Output PORTA.2
Output PORTA.3

'Ports that will switch the Relays
Output PORTB.0
Output PORTB.3
Output PORTB.4
Output PORTB.5



'--------------------------------------------'
'Symbol for LED indicator If they are On/OFF
Symbol led0 PORTA.0
Symbol led1 PORTA.1
Symbol led2 PORTA.2
Symbol led3 PORTA.3

'Symbol for Ports that will switch the Relays
Symbol led00 PORTB.0
Symbol led11 PORTB.3
Symbol led22 PORTB.4
Symbol led33 PORTB.5


'--------------------------------------------'
'Low led state at default start of the program
Low led0
Low led1
Low led2
Low led3


Dim x As Byte


loop:
'x for getting the serial
x = HRSIn

    'LED1
    If x = "A" Then
    High led00      'Switch ON Relay1 or PortB0 if serial = A
    DelayMS 1000    'Delay 1 second
    High led0       'Turn ON Led 1 indicator Relay 1 is ON

        ElseIf x = "B" Then
        Low led00       'Switch OFF Relay1 or PortB0 if serial = B
        DelayMS 1000    'Delay 1 second
        Low led0        'Turn OFF Led 1 indicator Relay 1 is OFF
        EndIf
    
    'LED2
    If x = "C" Then
    High led11
    DelayMS 1000
    High led1

        ElseIf x = "D" Then
        Low led11
        DelayMS 1000
        Low led1
        EndIf

    'LED3
     If x = "E" Then
     High led22
     DelayMS 1000
     High led2
 
        ElseIf x = "F" Then
        Low led22
        DelayMS 1000
        Low led2
        EndIf
  
    'LED4       
    If x = "G" Then
    High led33
    DelayMS 1000
    High led3
     
        ElseIf x = "H" Then
        Low led33
        DelayMS 1000
        Low led3
        EndIf
    

GoTo loop
End


Visual Basic Code
Code:
Imports System
Imports System.IO
Imports System.IO.Ports
Imports System.Threading
Imports System.ComponentModel


Public Class Automation



    Private Sub Automation_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load


        RS232.Close()
        RS232.PortName = "com11" 'change com port to match your Arduino port
        RS232.BaudRate = 9600
        RS232.DataBits = 8
        RS232.Parity = Parity.None
        RS232.StopBits = StopBits.One...[/quote]

[url=https://www.electronicspoint.com/projectlogs/visual-basic-proton-basic-proteus.13/]Read more about this showcase item here...[/url]
 

brian22

Jul 19, 2013
40
Joined
Jul 19, 2013
Messages
40
Attaching further information.
 

Attachments

  • Doc.zip
    1,003.6 KB · Views: 239
Top