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. General Discussion
  3. Basic Setup Network

Basic Setup Network

Scheduled Pinned Locked Moved General Discussion
2 Posts 2 Posters 809 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.
  • aaronik19A Offline
    aaronik19A Offline
    aaronik19
    wrote on last edited by
    #1

    Sorry I know that I am writing a stupid question but I am a little bit confused. I am trying to make a very basic node to node program; from one NRF24 to another NRF24. Send command from 1 module to light LED on the other module. I read more than twice the API (http://www.mysensors.org/download/sensor_api_15) but still get ground! Is there a basic network please to light led on the other side and I will continue from there please?

    Sorry once again, but I really need some help to get on.

    1 Reply Last reply
    0
    • noelgeorgiN Offline
      noelgeorgiN Offline
      noelgeorgi
      wrote on last edited by noelgeorgi
      #2

      this is my node to node program:

      // Enable debug prints
      #define MY_DEBUG
      #define SWITCH_PIN 2
      // Enable and select radio type attached
      #define MY_RADIO_NRF24
      //#define MY_RADIO_RFM69
      boolean state=false;
      #include <SPI.h>
      #include <MySensor.h>  
      #define MY_NODE_ID 10
      #define CHILD_ID_SWITCH 1 
      
      MyMessage switchMsg(CHILD_ID_SWITCH, V_LIGHT);
      
      void setup()
      {
        pinMode(SWITCH_PIN,INPUT_PULLUP);
      }
      
      void loop()
      {
        if(digitalRead(SWITCH_PIN)==LOW)
        {
          delay(100);
          if(digitalRead(SWITCH_PIN)==HIGH);
          {
            state=!state;
            if(state)
            {
              send(switchMsg.setDestination(2).set(49));
            }
            else
            {
              send(switchMsg.setDestination(2).set(0));
            }
          }
        }
      }
      
      • destination node id is 2
      • destination of type light variable
      1 Reply Last reply
      1
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      21

      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