Forum Coding Corner Device Sketches

Viewing 5 reply threads
  • Author
    Posts
    • #6631
      Martyn

        Here are some working sketches that make functional devices. Please feel free to post your own in this thread. I’ll add them to this list if they are easy to read and well commented.

        Digital Clock
        Boards: MOTHERBOARD, DIGITISER
        Function: Display the time, date, and year on the digitiser. Uses one of the buttons on the digitiser to select time, date or year. Uses the potentiometer to adjust brightness.

        DOWNLOAD

        Clock and Sensor Display
        Boards: MOTHERBOARD, DIGITISER, SENSOR ARRAY
        Function: Display the time, temperature and relative humidity on the digitiser. Uses one of the buttons on the digitiser to toggle between them. Uses the potentiometer to adjust brightness.

        DOWNLOAD (Link coming soon)

        RGB Sensor Bar Display
        Boards: MOTHERBOARD, RGB MATRIX, SENSOR ARRAY
        Function: Display the relative light levels, humidity, temperature and sound levels on the RGB Matrix as bars.

        DOWNLOAD (comments not finished)

        Sensor Data Logger
        Boards: MOTHERBOARD, SENSOR ARRAY
        Function: Saves the temperature, relative humidity and time every 5 mins in a text file on a micro SD card.

        DOWNLOAD

        RGB Alarm
        Boards: MOTHERBOARD, RGB MATRIX
        Function: Flashes the RGM Matrix at a set time. Can be used as a reminder light. Add a new if statement for each alarm. Change the colour or pattern by changing the bits when shifting out.

        DOWNLOAD

        • This topic was modified 2 years, 11 months ago by Martyn.
        • This topic was modified 2 years, 11 months ago by Martyn.
        • This topic was modified 2 years, 10 months ago by Martyn.
      • #6675
        schole28

          Hi Martin

          The Sketch of DigiClock has a little bug inside:

          […]

          //RTC Stuff

          rtc.begin();

          //rtc.adjust(DateTime(__DATE__,__TIME__));; // Set the RTC to Compile Date and Time

          //DIGITISER Stuff

          pinMode(SER, OUTPUT); // SER (data) pin as output

          […]

          The two // before rtc.adjust should be removed.

          Regards

          Jean-Luc

          • #6695
            Martyn

              Hi, thanks for the input. With that line of code, we want to uncomment it to set the time, then put the comments back and re-upload the code. If you leave it uncommented, every time you restart the device, the time will reset to the time you uploaded it. I should have written that in the comment to explain, sorry. I’ll make the changes and update the link.

              EDIT: I have updated the link. I have also changed the pin numbers to match the diagrams in the manuals

              • This reply was modified 2 years, 10 months ago by Martyn.
          • #6721
            udenk

              EDIT: I have updated the link. I have also changed the pin numbers to match the diagrams in the manuals

              not sure what you updated, but the link here still has the commented line.

              • #6724
                udenk

                  ok, it pays to read the comment in line 94.

                  • This reply was modified 2 years, 10 months ago by udenk.
              • #6722
                udenk

                  fwiw date is in DD/MM

                • #6745
                  dplass

                    What’s the license/copyright on the sketches in the manuals? I’d like to publish my own versions (with enhancements) and share them with the community via GitHub.

                    • #6823
                      Martyn

                        Totally open source. I would love to see any modifications and enhancements you can come up with! I designed these kits as a starting point, hoping the community would make them their own. So, thanks for sharing!

                        • #6825
                          dplass

                            Here ya go:

                            https://github.com/dplassgit/short_circuits

                            Most significantly, I reverse-engineered how to control the RGB matrix. There is other sample code in the repo as well. It’s under an MIT license, so anyone can do pretty much anything they want with it.

                            • #6850
                              Martyn

                                Thanks! I’d love to see this as scrolling text! I also wonder how the 8×8 single colour matrix I’m making will fare with this kind of text…

                                It looks like you have a fair amount of coding experience. Do you fancy reverse engineering this to get it working with the RGB Matrix board? I designed my board before seeing this guys code, so it doesn’t work out of the box. The guy who wrote it said I could adapt it, but I just don’t have the coding skill. No worries if not, just thought I’d ask 🙂

                                Thanks again for sharing your code!

                        • #8002
                          pjhi9man

                            Hi Martin, I’ve been playing with the digitizer board for a little while now – all good – I gather sw2 and the LED4 (RED) are for us to program as your sketch doesn’t utilize these!

                            Keep up the good work – I’m enjoying learning how to put the boards together and code

                            • #8008
                              Martyn

                                Absolutely! You can program the device in whatever way you see fit! The example code is just there to show you how it all works.

                                Happy coding!

                          Viewing 5 reply threads
                          • You must be logged in to reply to this topic.