This needs to be a lot cleaner, but I started off with the weather_brick
Sort of moved the brick code into the python area, hit lots of challenges
in getting it to compile probably better ways
I modified the python script to also retrieve current temp and some others stuff
like precipitation... But so far only played with temp.
Updated the Arduino sketch to use the Arduino_LED_Matrix library as well
as the ArduinoGraphics library.
Note: There are issues with the Matrix library, with the API bindings, (uint8_t vs int8_t versus int8_t). Some of this was resolved in current sources. However would
be better if the matrixWrite was defined using const like in this app extern "C" void matrixWrite(const uint32_t* buf);
Not much to look at yet, needs cleaning up, but now it alternates showing the
weather code symbol, with the temp
In order to make relevant information available to any who are interested in this subject, I'll share a link to the pull request @KurtE submitted to propose the change mentioned above:
I have been doing some additional hacking on the Weather sketch, I can now show temp, precipitation, wind Speed and direction...
Been playing with it more to learn some additional things about working on the Q.
Like how to pass data over the bridge. Currently I am passing all of the additional information between the two using an Array.
More details about this up in the thread:
I have also been playing with two different ways to output the text. One is one at a time, the other is scrolling text.
I first tried to use Modulino buttons to (button A) to switch between the two, but so
far that is not working.
So I plugged in a Sparkfun button, and that one is working.
Next up figure out why the Modulino buttons are not working.
Maybe it is because there are long delays between when I call update the update function.
Although I like the Sparkfun implementation better as it has method to ask, has the button been pressed, where it's firmware does the scanning of the button in the background.
Also still playing more with the building the Q bootloader on the Q
The functionality shown in the Arduino_Modulino Buttons example: Button2Integration
looks interesting in that it looks like you can setup handlers for click, double click, ...
However: It relies on using a Button2 object, which I would guess would maybe be defined
in the include: #include "Button2.h"
If it existed... Not sure where the file is/was... @ptillisch - I assume this is a known issue, although did not see anything obvious in the issues and PRs of:
This example is demonstrating how to use the popular 3rd party Button2 with the Modulino Buttons. Since the library is only a dependency of the example sketch, and not of the Arduino_Modulino library itself, Button2 was not specified as a dependency in the Arduino_Modulino library metadata. For this reason, it is necessary to install the Button2 dependency of the sketch in order to compile it:
Open your App in Arduino App Lab. ⓘ Unlike Arduino IDE which installs libraries globally for availability from any sketch project, Arduino App Lab installs libraries on a per-App basis, so this process will only make the library available for use in the specific App you have open at the time you perform it.
Click the button that looks like an open book with a + sign that is located to the right of the "Sketch Libraries" section heading in the left hand panel of the Arduino App Lab window.
The "Add sketch library" dialog will open.
Type Button2 into the "Search library" field of the dialog.
Scroll down through the search results until you find the entry for the "Button2" library.
Select the version of the library you want your App's sketch to use from the drop-down menu in the "Button2" library entry.
Click the "Install" button.
You will see a "___ installed" tag appear on the entry.
Click the X icon at the top right corner of the "Add sketch library" dialog.
The dialog will close.
I submitted a pull request proposing to specify the need to install the library in the example's header comment:
The comment I propose mentions Arduino IDE Library Manager explicitly. I'm not sure whether this exactly addresses the confusion you experienced since I see now that this is in the context of an App project. However, example sketches are not presented to Arduino App Lab users and the sketch is not well tailored for use with the UNO Q (due to the reliance on Serial). So I don't think it makes sense to increase the verbosity of the example commentary in order to try to provide coverage for App Lab users.
Now looking over their code, it may not help in my case here, as it may be seconds between when I call buttons.update()
I was hoping that maybe there were additional capabilities within the firmware of the buttons processor, that maybe did the detection of at least a click...
That is correct. The repository and library was originally named "Modulino", but was later renamed "Arduino_Modulino" to follow the standard naming scheme for Arduino's libraries.
Looking over the sources is is really basic. I believe the same firmware is more or less burned into all of the Modulino boards. As far as buttons goes, the code simply reads the state of the three buttons (i.e. digitalRead) and returns it... That is it.
So reading the state of the buttons every lets say 5-10 seconds was not working very well as you would have to hold the button down for extended period of time to have it detected.
So in my Weather2 app, I created a thread, that checks every 250ms. I ran into issues where having the one thread doing Wire calls to this device and the main thread talking to the Sparkfun Button, so I added in a Mutex, I also did a quick and dirty attempt to update the button LED on both devices if there are two...
Code pushed up, same location as in post #7.
Not sure how much more I will do on this, one.
Arduino Wish list item: I know that for example with network like examples that Arduino has setup their examples to not have your network information in the main sketch. Would be nice if something was done similar for location.