Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
Imports System.IO.Ports
Public Class Form1
Dim WithEvents Port As SerialPort
Delegate Sub DS(ByVal D As Double)
Private Sub WS(ByVal D As Double)
RichTextBox1.Text = D
Label1.Text += 1
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Port = My.Computer.Ports.OpenSerialPort("COM5", 9600, Parity.None, 8, StopBits.One)
End Sub
Private Sub Port_DataReceived(ByVal sender As Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) Handles Port.DataReceived
Try
Dim STR As String
Dim Dou As String = Nothing
STR = Replace(Port.ReadLine.ToString, ".", ",")
For Each Z As String In STR
Try
If IsNumeric(Z) Then
Dou &= Z
End If
If Z = "," Then
Dou &= ","
End If
Catch ex As Exception
End Try
Next
If Dou = Nothing Then
Dou = "0"
End If
Me.Invoke(New DS(AddressOf WS), Double.Parse(Dou))
Catch ex As Exception
Exit Sub
End Try
End Sub
End Class