So I am trying to get a Pc (well mac) and a Cortex talking to each other over BT using a UART port. The connection is connected but transferring data is just garage. I am using the https://github.com/JMarple/BNSBluetooth framework
RobotC Code
#pragma config(UART_Usage, UART1, uartUserControl, baudRate38400, IOPins, None, None)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
#include "BNSlib_HC05.h"
task main()
{
setBaudRate(UART1, baudRate19200);
char myString[10];
while(1==1)
{
bnsSerialRead(UART1, myString, 10, 200);
writeDebugStream((myString);
delay(500);
}
}
Which prints out values like f~øø€x€ø10.000000˜øøxøø€x€ø10.000000
The PySerial code is ( i have also tried .encode on the string)
import serial
import time
count=1
ser = serial.Serial(port='/dev/tty.HC-05-DevB', baudrate=19200)
print("start")
print("connected to: " + ser.portstr)
while True:
ser.write("1234567890")
print("sent")
time.sleep (500.0 / 1000.0);
ser.close()
print("close")