Post Reply 
The ultimate partner for the HP Prime G2 - The Arduino Leonardo.
05-18-2023, 11:17 AM
Post: #8
RE: The ultimate partner for the HP Prime G2 - The Arduino Leonardo.
(05-18-2023 08:50 AM)Mark Power Wrote:  Excellent work! A few questions for you:
  1. Can you use the FT260 with the same HP Prime code (other than changing the device id)?
  2. What is the light sensor that you used?
  3. It looks like you have a potentiometer attached as well, is that for another input?
  4. Can you publish your source code and wiring sketch so that we can have a look and adapt it for other sensors?
  5. Did you have to do anything to the Leonardo other than plug it in?
It would be great if we could build a library of sensor interfaces and real-time graphing routines. I'm still trying to figure out why the BME680 sensor is giving odd results on the Prime, but works perfectly on a Raspberry Pi.

The code for using the FT260 is very similar but not the same. The FT260 needs to communicate with a code first, to define the type of communication, then a byte mentioning the length of data. While I could instruct the Arduino to send those bytes, I kept the program as simple as possible and only sent one byte at a time with the direct connection to Arduino Leonardo - resulting in a smoother graph. Using the Leonardo allows RAW HID bytes to be sent, you can just send relevant data numbers, or you could add a send marker and length data if you want.

The light sensor is just an LDR I had lying around, it is a resistor whose value is changed when light hits it. The reason that the potentiometer is there is to 'tune' the LDR to range the voltage it outputs somewhere between 0v and 5v so that the full range of light my torch can supply, covers the full range of the graph, it along with the LDR are acting as a voltage divider.

I certainly will post the code. I'm at work now, and will post it this evening.

The Leonardo has to have a program on it to run which needs the Arduino-HID Project library to become a recognisable HID device, just include that in the Arduino Program, and a few lines from the RAW-HID example depending on if you want to get data into the calculator or send data out of the calculator.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: The ultimate partner for the HP Prime G2 - The Arduino Leonardo. - matalog - 05-18-2023 11:17 AM



User(s) browsing this thread: 2 Guest(s)