Sending raw data over USB

I have a device (Specificity a Light-O-Rama USB adapter ) that receives raw hexadecimal values over USB. I am using an Arduino GIGA R1 WiFi to send theses values, but I cant find any documentation on doing so from the Arduino_USBHostMbed5 Library.

Any help would greatly be appreciated.

USB simply transmits bytes of data without any regard for their content. The interpretation of this data is left to the user software and the protocols that have been implemented.

Welcome to the forum

Please give an example of some values that you want to send

Some values that I’m looking to send are:
0x00
All the way up to 0xFF
And some in between:
0x56
0x81
0x01
As a few examples

With some of these values other values need to be sent with it. For example: most commands are in this order

  1. 0x00
  2. 0xFF
  3. Command
  4. Metadata
  5. Channel Number

I’m following this documentation documentation as to what I should send to the Light-O-Rama adapter:
(lightorama-protocol/PROTOCOL.md at master · Cryptkeeper/lightorama-protocol · GitHub)

In order to send multiple bytes you have two choices. You can either send a series of single bytes using individual Serial.write() commands like this

Serial.write(0x00);  //empty byte
Serial.write(0xFF);  //broadcast to all IDs
Serial.write(0x03);  //brightness command
Serial.write(0x0A);  //brightness level

or as a single command like this

byte data[] = {0x00, 0xFF, 0x03, 0x0A};
Serial.write(data, sizeof(data));  //send data from data buffer

This assumes that you have a serial link between the Arduino and the peripheral. Change the name of the serial port to match the one that you are using on the Arduino

How would I connect it directly to the USB A port on the Arduino GIGA

I know very little about the GIGA but if it is a USB A port then I don't think that you can use it for a Serial interface. Someone with more knowledge than me will need to give you advice

A simple Google search turned up this page

https://docs.arduino.cc/language-reference/en/functions/communication/serial/

from which it seems that the GIGA has 4 Serial interfaces

GIGA R1 WiFi 0(RX), 1(TX) 19(RX1), 18(TX1) 17(RX2), 16(TX2) 15(RX3), 14(TX3)

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.