Torque

Forums

Forums

Notifications
Clear all

Arduino

5 Posts
2 Users
0 Reactions
671 Views
(@subarus)
Posts: 6
Active Member
Topic starter
 

Hello everyone. I upload a sketch from wiki to arduino. The sketch is unchanged. The application does not connect to the arduino.

 
Posted : 06/03/2022 9:22 am
(@admin)
Posts: 6550
Member Admin
 

Hi!

There appears to be data corruption in the data coming from the arduino to torque (the corrupted characters you see in the start of the adapter status screen)

This may be that the TX and RX lines are connected together (which would cause corruption similar to this)

 
Posted : 06/03/2022 10:03 am
(@subarus)
Posts: 6
Active Member
Topic starter
 

Rx and tx are not connected. I downloaded another sketch to arduino to check the operation of Bluetooth and it works

 
Posted : 06/03/2022 10:18 am
(@admin)
Posts: 6550
Member Admin
 

Hi!

You'll need to investigate why there's corruption coming from the arduino then - the protocol only supports the standard ASCII character set, so anything else will likely get mangled if it is being sent from the arduino

If there's nothing strange being sent from the arduino, then there's something else going on as the extra (mangled) characters you can see in the adapter status screen are being sent to Torque and are likely a symptom of the problem

There should be no echo in the default sketch, therefore there should not be any mention of 'ATI' or 'GETDEFINITIONS' in the adapter status screen (that is never sent from the adapter to torque, only sent from torque to the adapter) so you will need to find out where the echo is coming from - this is usually down to RX/TX data lines being joined.

 
Posted : 06/03/2022 3:56 pm
(@subarus)
Posts: 6
Active Member
Topic starter
 

This code from wiki

const int SENSORSSIZE = 9 * 3; // each line is 9 attributes, and we have 3 lines.
const String sensors[SENSORSSIZE] = {
"0", ANALOG, IS_INPUT, "-", "Pot 1", "Potentiometer 1", "v", "0", "5",
"1", ANALOG, IS_INPUT, "-", "LDR 1", "Light Sensor 1", "v", "0", "5",
"4", DIGITAL,IS_OUTPUT, "0", "Dout1", "Digital Out 1", "bit", "0", "1"
};

This code from github

const String sensors[] = {
"0", ANALOG, IS_INPUT, "-", "Pot 1", "Potentiometer 1", "v", "0", "5",
"1", ANALOG, IS_INPUT, "-", "LDR 1", "Light Sensor 1", "v", "0", "5",
//"4", DIGITAL,IS_OUTPUT, "0", "Dout1", "Digital Out 1", "bit", "0", "1"
};
const int SENSORSSIZE = sizeof(sensors);

Code from wiki works, but not from github

 
Posted : 07/03/2022 6:09 pm
Share:

  Follow me on twitter