Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Hardware
  3. Combining 'Build' examples in to one Arduino

Combining 'Build' examples in to one Arduino

Scheduled Pinned Locked Moved Hardware
3 Posts 2 Posters 48 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    adds666
    wrote on last edited by
    #1

    I'm looking to use the examples from https://www.mysensors.org/build and combine them together in one arduino sketch so that one node can communicate a number of pieces of information back to the controller via a MAX485 module and network

    I understand this is quite simple and possible with multiple, one time actions. Simply double up on the items in the code
    For instance an arduino Mega:

    • Reading 10 button states https://www.mysensors.org/build/binary

    • Controlling 4 relay outputs https://www.mysensors.org/build/binary

    And maybe even when a function is called periodically with a "sleep time" between reads, such as:

    • Reading and updating temperature sensor https://www.mysensors.org/build/temp

    However, it's not clear to me if this can be done with sensors/actuators that are constantly 'working' for instance:

    • Controlling the brightness (via PWM) of a LED https://www.mysensors.org/build/dimmer

    • Controlling ws2812 LED data signal similar to https://www.domoticz.com/forum/viewtopic.php?f=42&t=8039&sid=71a5c0904f9a1662ff5447d264e6bb78

    Can I amalgamate these .ino files? Am I only limited by the PWM / SPI outputs? Do I need to understand interrupts? Can a button press here go to the controller, run through an automation rule (I use Openhab) and then action a relay on the same node?

    I'm drawing up some Gerber files for bespoke PCBs - the answer to the above will determine whether each function requires its own Arduino pro mini or whether I can simply have the functions ancilliary devices (relay, mosfet, 12v supply) on the pcb. I'll be sure to include the PCB somewhere for anyone else who would benefit from it.

    Many thanks in advance, Adam

    mfalkviddM 1 Reply Last reply
    0
    • A adds666

      I'm looking to use the examples from https://www.mysensors.org/build and combine them together in one arduino sketch so that one node can communicate a number of pieces of information back to the controller via a MAX485 module and network

      I understand this is quite simple and possible with multiple, one time actions. Simply double up on the items in the code
      For instance an arduino Mega:

      • Reading 10 button states https://www.mysensors.org/build/binary

      • Controlling 4 relay outputs https://www.mysensors.org/build/binary

      And maybe even when a function is called periodically with a "sleep time" between reads, such as:

      • Reading and updating temperature sensor https://www.mysensors.org/build/temp

      However, it's not clear to me if this can be done with sensors/actuators that are constantly 'working' for instance:

      • Controlling the brightness (via PWM) of a LED https://www.mysensors.org/build/dimmer

      • Controlling ws2812 LED data signal similar to https://www.domoticz.com/forum/viewtopic.php?f=42&t=8039&sid=71a5c0904f9a1662ff5447d264e6bb78

      Can I amalgamate these .ino files? Am I only limited by the PWM / SPI outputs? Do I need to understand interrupts? Can a button press here go to the controller, run through an automation rule (I use Openhab) and then action a relay on the same node?

      I'm drawing up some Gerber files for bespoke PCBs - the answer to the above will determine whether each function requires its own Arduino pro mini or whether I can simply have the functions ancilliary devices (relay, mosfet, 12v supply) on the pcb. I'll be sure to include the PCB somewhere for anyone else who would benefit from it.

      Many thanks in advance, Adam

      mfalkviddM Offline
      mfalkviddM Offline
      mfalkvidd
      Mod
      wrote on last edited by
      #2

      @adds666 with enough skill, time and knowledge, it is probably possible to do all of it in one node. The MySensors library does not (at least not to my knowledge) prevent you from doing everything in one node.

      If you haven't already, see https://forum.mysensors.org/topic/2597/combining-mysensors-examples/ for an instruction on how to combine two sketches.

      With that said, doing everything in one node will increase complexity. Mistakes / nuances that otherwise would not be a problem might make strange things happen. And troubleshooting a complex node is at least 10x harder than troubleshooting a node with only one task.

      A 1 Reply Last reply
      1
      • mfalkviddM mfalkvidd

        @adds666 with enough skill, time and knowledge, it is probably possible to do all of it in one node. The MySensors library does not (at least not to my knowledge) prevent you from doing everything in one node.

        If you haven't already, see https://forum.mysensors.org/topic/2597/combining-mysensors-examples/ for an instruction on how to combine two sketches.

        With that said, doing everything in one node will increase complexity. Mistakes / nuances that otherwise would not be a problem might make strange things happen. And troubleshooting a complex node is at least 10x harder than troubleshooting a node with only one task.

        A Offline
        A Offline
        adds666
        wrote on last edited by
        #3

        @mfalkvidd many thanks for coming back. I think I'll keep more complex things seperate, however will explore multiple binary sensors and relays on the same node.

        Thanks

        1 Reply Last reply
        1
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        20

        Online

        11.7k

        Users

        11.2k

        Topics

        113.1k

        Posts


        Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • MySensors
        • OpenHardware.io
        • Categories
        • Recent
        • Tags
        • Popular