Page 1 of 1

Formula Allcode using VS C#

Posted: Thu Feb 03, 2022 3:06 pm
by HOCKERNANT
Hi hope you can help with this.

I'm using C# in Visual studios 2019 with my Formula AllCode. I am trying to code it so it uses the IR sensors to navigate environment.

I've set up 2 variables 1 for outgoing ports used for movement commands and a 2nd for the incomming port to get feedback from the sensors. I have double checked that the ports have been correctly assigned but i am getting no feedback from any of the IR Sensors

This is the code i am using:

char incomingPortNumber = (char)8;

FA_DLL.FA_ComOpen(incomingPortNumber);

uint ir = FA_DLL.FA_ReadIR(incomingPortNumber, (char)1);


The output for the sensors is always 0 regardless of objects are in the way or not.

I am using using V3 but I have read this similar issue may have been resolved in a later version, is this true?

Thanks,
Adam

Re: Formula Allcode using VS C#

Posted: Mon Feb 07, 2022 6:22 pm
by Benj
Hi Adam,

The terms incoming and outgoing are misleading and not really applicable.

The incoming port I beleive is for talking to the Bluetooth module directly using AT commands, you shouldn't ever need to use it.

You should do all AllCode commands via the Outgoing port and this will allow all the AllCode API commands to function.