Hello folks, I am new here so my knowledge or arduino and c++ are limited, but I do have some coding knowledge with other platforms so all knowledge won't be lost on me I promise! I have a simple program that I am writing for a hobby experiment, I purchased a MotorAir V1 (it has a bluetooth but we are just using the usb port) and I am trying to get it to communicate via com port commands, which I have had some success on with powershell in a simple script (The board spins a motor one way or another):
$count = 0
function getnum($a,$b, $c) {
$numbers = [char[]]@($a, $b, $c)
$numbers = -join $numbers
Write-Output($numbers)
return $numbers
}
$port = new-Object System.IO.Ports.SerialPort COM3,9600,None,8,one
$port.Open()
$port.WriteLine((getnum 102 255 50))
$port.Close()
In a nutshell, the script takes the numbers values given in the second to last line, converts it into character/text, in this case "fÿ" which seems to be the only type of command the board program will read, because if i send 102 255 or 0x64 0xFF there is no response other than lights. (Nevermind the $C variable the third bite is not read anyways by the code it seems) Here is the board code (straight from OEM)
Now, the issue, when I use this code 102 255 the actual motor speed output is not that, it is more like 102 150ish it seems (first bite is direction second is speed), since when I use the OEM provided "tool" they send out to test connections, it goes much faster than what I am getting at the same settings.
Could there be an issue with how the commands are sent or a probelm in the code?
Here is a link to the board itself, there are example of the OEM program on the page just no source code to bridge the gap