How to handle multiple hardware generations?

I have both the older generation of Haply device and the new Haply 2diy. I think the sample code in Files · processing · Haply / 2diy / learn · GitLab is supposed to support both generations, but I’m not quite sure how to set this up, the Pantograph constructor requires a hardwareVersion. hardwareVersion == 3 is clearly the most recent version, but would the older be 1 or 2? Neither seems to work for my older devices.
sketch_4_Wall_Physics, sketch_5_Shapes_Physics, and sketch_6_Maze_Physics check for the hardware version in the SimulationThread, but they only cater for versions 2 and 3, what should be the correct setup values be for hardware version 1?

Hi @kai ,

The two latest generation are pictured on the page https://2diy.haply.co/ , the left one being the version 2 and the right one the version 3.

The first generation could also work but the parameters for the pantograph would have to be manually added.

Right. I have an even older generation than that. I decided to call it hardware version 1 in the absence of better data. Things sorted themselves when I realised I had to edit the Pantograph.java code as well. I now have nifty switches in (I hope) all the right places and my code runs for the devices I’ve got.

Awesome !

I’d be happy to integrate the changes for the V1 if you have them handy, that way we can keep a version online for the next time you’ll need it.
You might be able to attach the pantograph file here, or do a pull request on the gitlab repo.

Best regards,
Antoine

I made a version of the Device Setup program that works for both my old and newer device. Two notes though:

  1. The programs in Haply / 2diy / learn · GitLab do rather different device setups with no explanations for why this is, so I am a bit uncertain on what bits actually are important.
  2. The devices have physically different ranges, so I will muck about a bit more and try to figure out exactly what values make best sense, and update the files accordingly.

I tried to attach my modified files here, but apparently it is not possible to upload .pde and .java files, so I’ll have to figure out how pull requests work.