interacting with rawhid example using Teensy 3.1, Arduino 1.0.5

Status
Not open for further replies.

equipoise

New member
Hi,

I'm making my first step toward using Teensy 3.1 to act as an HID device and exchange messages/reports with a host (Mac OS 10.7.5). I've installed Arduino 1.0.5, run Teensyduino 1.18-rc1 to install its stuff into Arduino, and have loaded and run the Teensy USB_RawHID "Basic" sketch on the Teensy. This runs ok under Arduino, as can be seen by the Serial.println() output in the Arduino "Serial Monitor" window ("Transmit packet 1", "Transmit packet 2", etc.).

While this is happening, I run the hid_listen.mac program upon my computer to monitor output from the Teensy. All I see in hid_listen.mac Terminal window is an endless "Waiting for device:..............................", with the number of period characters increasing periodically (ha ha ha).

Also, when I enter text into the text entry field of the Serial Monitor window of Arduino and hit return, I imagined that I would see those characters passed to the hid_listen.mac Terminal window or into the sketch output in the Serial Monitor window. They don't. If I modify the sketch to try to force some text to be sent to output each time through the loop, it doesn't happen. I tried this by modifying the sketch by adding a line:

void loop() {
int n;
n = RawHID.recv(buffer, 0); // 0 timeout = do not wait
if (n > 0) {
Serial.println(F("my text"));

My modification is the final line shown here, but no output is produced. I haven't really looked into how the RawHID.recv() command actually works, so perhaps this part of my effort is inherently doomed.

My questions: How have I misconceived or wrongly executed the use of HID in all of this? How can I get my Teensy 3.1 to be seen as an HID device by the host computer (Mac OS) so that I can send strings to it and receive strings from it? If I'm up the wrong creek here, is there another example, tutorial, etc. that I should be looking at?

Thanks.

-- equipoise
 
Status
Not open for further replies.
Back
Top