View Single Post
  #6   Spotlight this post!  
Unread 13-03-2015, 16:00
KMBruggeman KMBruggeman is offline
Registered User
FRC #3737 (RotoRaports)
Team Role: Programmer
 
Join Date: Mar 2015
Rookie Year: 2014
Location: Goldsboro, NC
Posts: 8
KMBruggeman is an unknown quantity at this point
Using the A x-axis data stream

As I was meandering through the code this afternoon I had this random thought. It looks the axis values are defined in "USB_gamepad.h" source such that they are contained in the data structure "USB_GamepadReportTx".

https://github.com/TI-FIRST/MSP430-G.../USB_gamepad.h

If I look at that it appears that *.ax, *.ay, etc are all 16bit integers. Could I modify the code from https://github.com/TI-FIRST/MSP430-G...b/master/hal.c (line 517)

from: "gamepadReportTx.ax = Convert8Bit(ADC12_A_getResults(ADC12_A_BASE, ADC12_A_MEMORY_12));"
to "gamepadReportTx.ax = encoder_count;" as that would allow me in essence to have up to 8 x 16BIT signed integers in my HID data stream?

(gamepadReportTx is defined on line 151 to type USB_GamepadReportTX from the first linked file.)

I would then just need to see how LV views/processes that data converting it into a float with the range -1.0 to 1.0 but my guess would be by dividing it by 2^15 ...

Am I totally off base here or is my lack of sleep starting to pay off?
Reply With Quote