Formula Allcode using VS C#

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
HOCKERNANT
Posts: 1
Joined: Thu Feb 03, 2022 2:37 pm
Contact:

Formula Allcode using VS C#

Post 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

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Formula Allcode using VS C#

Post 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.

Post Reply