Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
On Error Resume Next
Dim comport As Integer
Dim onstate, outstring
onstate = 0
If Button1.Text = "Pin 6 on" Then
Button1.Text = "Pin 6 off"
onstate = 1
outstring = "!"
End If
If Button1.Text = "Pin 6 off" And onstate = 0 Then
Button1.Text = "Pin 6 on"
outstring = "$"
End If
comport.Write(outstring)
End Sub
sorry about no tags, I copied & slightly altered the code. I have been studying VB with little success, My main area of expertise is electronic circuit designing & building. I really want to learn VB, any advice or hlp would be GREATLY appreciated! I'm building an interface between VB & arduinos to control items around the house, all is complete except for the VB end - I'm starting with just one button to simplify things. Thank you for your time!
This post has been edited by smohd: 12 August 2012 - 04:33 AM

New Topic/Question
Reply



MultiQuote








|