I am looking for some assistance migrating a couple of libraries to work on a Particle Argon.
I’m looking to use the Grove Digital Light sensor TSL2561and Grove Temperature and Humidity sensor TH02 with an Argon via the Grove shield.
I’ve read up a bit on the forums and I understand I need to replace Arduino.h with Particle.h and don’t need to call Wire.h as it’s automatically included. I have also read something about potentially changing variable datatypes based on the fact the Argon has a 32bit architecture.
I have had a crack at this in Visual Studio Code with Particle Workbench installed and IntelliSense goes crazy when I try not to include Wire.h in the library files.
Any guidance on whether my understanding outlined above is correct and whether I’m on the right track with the link files would be greatly appreciated.
That's probably because VS Code doesn't recognise your project as targeting the Particle platform.
You may need to Particle: Create Project first and then add the libraries to that project in order to have VS Code understand the context.
You know when VS Code knows it's dealing with a Particle project when you see these in the top right
Since REG_CONFIG and CMD_MEASURE_TEMP are defined in TH02_dev.h and not in Wire.h it is quite surprising that these flags would go away when including Wire.h.
Hence this seems to be a case of bad IntelliSense resolution (again).
Have you tried building the project and do the IntelliSense flags persist after that?
I did see in another thread you mentioned IntelliSense being fairly temperamental. I’ll take a look at those threads. Probably something I can learn to ignore.
Outside of issues with IntelliSense is my understanding and implementation of the migration process correct?
One additional note on the datatypes you mentioned: It’s not only the types but also the endianness which might (does) differ between platforms that needs consideration.