Quantcast
Viewing all articles
Browse latest Browse all 40524

Raw Hid + Teensy 3.1 + oF

To get that in firmata you would have to alter the standard firmata to make the latency that low. Firmata comes packaged with arduino it utilizes a midi style communication protocol between arduinos and a client. A client is part of the core of openframeworks and there are examples how to use it.

I can see why using a raw hid might be applicable. try adding the header and appropriate c file to your project and then import it into ofApp.h which should allow you to connect once you call the appropriate functions. so in the setup call

these defines seem arbitrary and i just got them from the example but include them in ofApp.h

#define VENDOR_ID               0x16C0
#define PRODUCT_ID              0x0480
#define RAWHID_USAGE_PAGE       0xFFAB  // recommended: 0xFF00 to 0xFFFF
#define RAWHID_USAGE            0x0200  // recommended: 0x0100 to 0xFFFF

Then in setup in ofApp.cpp

rawhid_open(0, VENDOR_ID,PRODUCT_ID, RAWHID_USAGE_PAGE, RAWHID_USAGE);

you may want to thread this because if you want that kind of latency you will have to call rawhid_recv faster than update and draw is called in openframeworks unless you disable vertical syncing and another problem would be filling the buffer faster than it can be read or cleared which then you are losing accuracy anyways.


Viewing all articles
Browse latest Browse all 40524

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>