colinodowd
Member
I am attempting to send data from a C# GUI to the Teensy 3.2 via the OUTGOING Bluetooth port on my PC but am having no luck. The data transfer is working in the opposite direction (sending data from Arduino to C# GUI). I am using the INCOMING Bluetooth port on Putty to try to see the "test string" but am getting no results. I am, however, getting a constant string of -1s????
Teensy code:
C# code (I am basically just sending a test string on repeat):
Teensy code:
Code:
#define HWSERIAL Serial1
void setup() {
HWSERIAL.begin(9600);
}
void loop() {
String command = HWSERIAL.read();
HWSERIAL.print(command);
HWSERIAL.println();
}
C# code (I am basically just sending a test string on repeat):
Code:
private void button11_Click(object sender, EventArgs e)
{
portBTSend = new SerialPort("COM24", 9600, Parity.None, 8, StopBits.One);
portBTSend.RtsEnable = true;
portBTSend.DtrEnable = true;
try
{
portBTSend.Open();
}
catch (Exception e1)
{
label8.Text = "Connection to BT Failed. Try Again";
}
while () {
portBTSend.Write("TEST STRING");
System.Threading.Thread.Sleep(1000);
}
}