void setup() { pinMode(A0 && A1 && 2 && 3, INPUT); pinMode(12 && 13, OUTPUT); Serial.begin(9600); while(Serial.available() <= 0) { establishContact(); } } void loop() { if (Serial.available() > 0) { int rdval = Serial.read(); if(rdval == '11') { digitalWrite(13, 1); } delay(100); } } void establishContact() { int val1 = analogRead(A0); else if( val1 !=0 ) { Serial.println("a"); } delay(100); }
Private Sub ReceivedText(ByVal [text] As String) If Me.TextBox1.InvokeRequired Then Dim d As New SetTextCallback(AddressOf ReceivedText) Me.Invoke(d, New Object() {[text]}) Else If [text] = "a" Then serialport1.write("11") End If End If End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)