I've been designing a Trill-based peripheral for a project and thought I'd try and use some of the Picos I have lying around my desk.

If I could crack this I could finally use them up and they look like really capable boards with plenty of IO and power.

I've managed to get it to build and recognise the Square I have to hand but I have no idea why I can't seem to get the size or location of the touch, just the number.

I've already had a little bit of a play with and had ported most of the Trill-Linux library to openFrameworks and Raspberry Pi with some success so I thought I'd try my hand at trying to do the same for the Pico because I have a pile of them.

Does anyone want to have a look and maybe pitch in? @Grumpy_Mike I saw the work you did in porting the library to MicroPython, are you up to having a crack? @giuliomoro I know you're a developer of some skill.

https://github.com/PeteHaughie/Trill-Pico

FWIW I've also tried the Pico in Arduino mode and can't seem to get that to work with the Trill library at all, but then again I also couldn't get that to work with a Seeeduino Xiao either… I could however get it working fine with an Arduino Micro as a last hail mary to unblock me.

    if memory is not at a premium and there is a dynamic allocator, I recommend using the Linux library as is (https://github.com/BelaPlatform/Bela/tree/master/libraries/Trill), only reimplementing the I2c.h file specifically for your platform.

    Examples:

    I still recommend the approach above, but this will fix it:

    diff --git a/Trill.cpp b/Trill.cpp
    index 160462b..612c52a 100644
    --- a/Trill.cpp
    +++ b/Trill.cpp
    @@ -9,7 +9,7 @@
    
     // Constructor
     Trill::Trill() : i2c(nullptr), i2c_address(0), mode(AUTO), device_type(NONE), firmware_version(0), numChannels(0),
    -                 posRescale(0), sizeRescale(0) {}
    +                 posRescale(1), sizeRescale(1) {}
    
     // Destructor
     Trill::~Trill()

    Flowdeeps FWIW I've also tried the Pico in Arduino mode and can't seem to get that to work with the Trill library at all,

    see https://forum.bela.io/d/2998-setting-analog-in-pins-for-trill-square-with-pi-pico-using-arduino-ide/4