-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Out-of-the Box Arduino Package #19
Comments
Could you try and replace the typedef in |
Thx @rnestler
Compiles for 3 arduinos that I tried. |
Whoops. I then realised that I had not compiled in the specific sensirion_uart_implementation.cpp for arduino. This references a struct type called "Uart" which is not defined
Looking for this in the distribution but not finding it. |
The sample implementation was done for a Arduino M0 Pro with a ATSAMD21 and will not work on any Arduino board. Depending on the Arduino board a different approach is needed. Since each serial port can only be used for one device, we can not use the same serial port for the SPS30 as we use to connect the PC with the Arduino for programming and debugging. Since Arduino has different variations there is no generic solution that works for all boards. If your board already has a second (or even more) serial ports, you can just use that one. You can check if your boards support the SoftwareSerial or AltSoftSerial library Let us know what Arduino boards you are using and if one of those libraries worked. Of course you have to adapt the sample implementation to use the library. |
Thx @psachs |
Spot on. For the Leonardo it actually shouldn't be that bad: Quote from https://www.arduino.cc/reference/en/language/functions/communication/serial/
Most of the example may still be valid if you remove the definition for s16 sensirion_uart_open() {
Serial1.begin(BAUDRATE);
return 0;
} The defines Good luck, let us know if that works. |
Thx @abrauchli |
Hi @paultanner, thanks for the feedback. We are trying to improve the situation for Arduino and provide ready-to-use samples for different boards, so we'd be glad to get a tested config for yours as well. Feel free to take a look or review the Arduino-specific README Sensirion/embedded-common#15 (it's for the i2c variants for now, but most things apply to the UART version as well). |
Related to #17 |
We do have Arduino libraries for most of our newer sensors available. |
I have followed the instructions (on MacOS) and got a viable folder in my Arduino setup - almost :-(
On building this I get typedef conflicts, possibly because I have not adjusted sensirion_arch_config.h
Errors such as "previous declaration as 'typedef short unsigned int u16' typedef unsigned short u16"
If I delete the u16 typedef I get "sensirion_uart.h:61: error: unknown type name 'u16'"
Same issue on Leonardo, Mega and Uno.
Any suggestions pls?
The text was updated successfully, but these errors were encountered: