hi guys,
What do i have to do to make the Bluetooth example can work with this code Arduino
I added two buttons to test, nothing happen
Sub Button1_Click
Dim b As Byte
b = 1
CallSub2(Starter, "SendMessage", Array As Byte(0, b))
End Sub
Thanks
What do i have to do to make the Bluetooth example can work with this code Arduino
I added two buttons to test, nothing happen
Sub Button1_Click
Dim b As Byte
b = 1
CallSub2(Starter, "SendMessage", Array As Byte(0, b))
End Sub
Thanks
B4X:
Sub Switch1_CheckedChange(Checked As Boolean)
Dim b As Byte
If Checked Then b = 1 Else b = 0
CallSub2(Starter, "SendMessage", Array As Byte(0, b))
End Sub
Sub btnConnect_Click
rp.CheckAndRequest(rp.PERMISSION_ACCESS_COARSE_LOCATION)
Wait For Activity_PermissionResult (Permission As String, Result As Boolean)
If Result Then
CallSub(Starter, "Connect")
Else
ToastMessageShow("No permission", True)
End If
End Sub
Sub lblStatus_Click
End Sub
public Sub RetornaTextoBluetoothname As String
Return bluetoothname.text.trim
End Sub
Sub Button1_Click
Dim b As Byte
b = 1
CallSub2(Starter, "SendMessage", Array As Byte(0, b))
End Sub
Sub Button2_Click
Dim b As Byte
b = 0
CallSub2(Starter, "SendMessage", Array As Byte(0, b))
End Sub
B4X:
void setup()
{
Serial.begin(9600);
pinMode(13, OUTPUT);
}
int state;
void loop(){
if(Serial.available() > 0) {
state= Serial.read();
if(state == '0')
{
digitalWrite(13, LOW);
}
if(state == '1')
{
digitalWrite(13, HIGH);
}
}
}