• Welcome to PiBoSo Official Forum. Please login or sign up.
 
April 25, 2024, 04:44:37 PM

News:

GP Bikes beta21c available! :)


Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - Antian

1
Custom hardware / Send values via USB to arduino??
August 26, 2020, 03:13:00 PM
Anyone have a good way of sending values (lets say m_fRoll) to arduino via USB and not udp?
I've tried using example codes but does not establish connection (com port 3 in my case).
Right now I'm simply trying to establish connection and send test data, so code is simplistic.
I've attached the C_code and Arduino test code. Any help very much appreciated.

The error I receive is microsofts HANDLE error _INVALID_HANDLE_VALUE code 2 which means _FILE_NOT_FOUND, in other words can't find device on com port 3.
I'm not sure if its a windows issue or the arduino. If I run this code as HANDLE port = CreateFile("COM3", ) .... no connection is established, but if I run as CreateFileA or as (L"COM3")... then it acts like a port is established but see no data going through. Microsoft says to only use CreateFile because it's a macro that will make the correct actions based on the device.