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. Development
  3. Basic project setup from start to finish

Basic project setup from start to finish

Scheduled Pinned Locked Moved Development
17 Posts 4 Posters 4.8k Views 4 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.
  • toddsantoroT Offline
    toddsantoroT Offline
    toddsantoro
    wrote on last edited by
    #7

    Here is what my Arduino folder looks like: https://www.dropbox.com/s/hfsg3d1xkcoydqq/Screenshot 2016-10-21 16.36.51.png?dl=0

    mfalkviddM 1 Reply Last reply
    0
    • toddsantoroT Offline
      toddsantoroT Offline
      toddsantoro
      wrote on last edited by
      #8

      Should I create another folder in there called sketches? Here is my sketch copy and pasted from the example on this page: https://www.mysensors.org/build/motion

      /**
       * The MySensors Arduino library handles the wireless radio link and protocol
       * between your home built sensors/actuators and HA controller of choice.
       * The sensors forms a self healing radio network with optional repeaters. Each
       * repeater and gateway builds a routing tables in EEPROM which keeps track of the
       * network topology allowing messages to be routed to nodes.
       *
       * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
       * Copyright (C) 2013-2015 Sensnology AB
       * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
       *
       * Documentation: http://www.mysensors.org
       * Support Forum: http://forum.mysensors.org
       *
       * This program is free software; you can redistribute it and/or
       * modify it under the terms of the GNU General Public License
       * version 2 as published by the Free Software Foundation.
       *
       *******************************
       *
       * REVISION HISTORY
       * Version 1.0 - Henrik Ekblad
       * 
       * DESCRIPTION
       * Motion Sensor example using HC-SR501 
       * http://www.mysensors.org/build/motion
       *
       */
      
      // Enable debug prints
      // #define MY_DEBUG
      
      // Enable and select radio type attached
      #define MY_RADIO_NRF24
      //#define MY_RADIO_RFM69
      
      #include <MySensors.h>
      
      unsigned long SLEEP_TIME = 120000; // Sleep time between reports (in milliseconds)
      #define DIGITAL_INPUT_SENSOR 3   // The digital input you attached your motion sensor.  (Only 2 and 3 generates interrupt!)
      #define CHILD_ID 1   // Id of the sensor child
      
      // Initialize motion message
      MyMessage msg(CHILD_ID, V_TRIPPED);
      
      void setup()  
      {  
        pinMode(DIGITAL_INPUT_SENSOR, INPUT);      // sets the motion sensor digital pin as input
      }
      
      void presentation()  {
        // Send the sketch version information to the gateway and Controller
        sendSketchInfo("Motion Sensor", "1.0");
      
        // Register all sensors to gw (they will be created as child devices)
        present(CHILD_ID, S_MOTION);
      }
      
      void loop()     
      {     
        // Read digital motion value
        bool tripped = digitalRead(DIGITAL_INPUT_SENSOR) == HIGH;
      
        Serial.println(tripped);
        send(msg.set(tripped?"1":"0"));  // Send tripped value to gw 
      
        // Sleep until interrupt comes in on motion sensor. Send update every two minute.
        sleep(digitalPinToInterrupt(DIGITAL_INPUT_SENSOR), CHANGE, SLEEP_TIME);
      }```
      mfalkviddM 1 Reply Last reply
      0
      • toddsantoroT toddsantoro

        Here is what my Arduino folder looks like: https://www.dropbox.com/s/hfsg3d1xkcoydqq/Screenshot 2016-10-21 16.36.51.png?dl=0

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

        @toddsantoro something in the Arduino IDE is referencing libraries/TAS_motion_sensor. Do you have any idea what it could be? As AWI said, nothing should expect TAS_motion_sensor to be in the libraries folder.

        toddsantoroT 1 Reply Last reply
        0
        • toddsantoroT toddsantoro

          Should I create another folder in there called sketches? Here is my sketch copy and pasted from the example on this page: https://www.mysensors.org/build/motion

          /**
           * The MySensors Arduino library handles the wireless radio link and protocol
           * between your home built sensors/actuators and HA controller of choice.
           * The sensors forms a self healing radio network with optional repeaters. Each
           * repeater and gateway builds a routing tables in EEPROM which keeps track of the
           * network topology allowing messages to be routed to nodes.
           *
           * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
           * Copyright (C) 2013-2015 Sensnology AB
           * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
           *
           * Documentation: http://www.mysensors.org
           * Support Forum: http://forum.mysensors.org
           *
           * This program is free software; you can redistribute it and/or
           * modify it under the terms of the GNU General Public License
           * version 2 as published by the Free Software Foundation.
           *
           *******************************
           *
           * REVISION HISTORY
           * Version 1.0 - Henrik Ekblad
           * 
           * DESCRIPTION
           * Motion Sensor example using HC-SR501 
           * http://www.mysensors.org/build/motion
           *
           */
          
          // Enable debug prints
          // #define MY_DEBUG
          
          // Enable and select radio type attached
          #define MY_RADIO_NRF24
          //#define MY_RADIO_RFM69
          
          #include <MySensors.h>
          
          unsigned long SLEEP_TIME = 120000; // Sleep time between reports (in milliseconds)
          #define DIGITAL_INPUT_SENSOR 3   // The digital input you attached your motion sensor.  (Only 2 and 3 generates interrupt!)
          #define CHILD_ID 1   // Id of the sensor child
          
          // Initialize motion message
          MyMessage msg(CHILD_ID, V_TRIPPED);
          
          void setup()  
          {  
            pinMode(DIGITAL_INPUT_SENSOR, INPUT);      // sets the motion sensor digital pin as input
          }
          
          void presentation()  {
            // Send the sketch version information to the gateway and Controller
            sendSketchInfo("Motion Sensor", "1.0");
          
            // Register all sensors to gw (they will be created as child devices)
            present(CHILD_ID, S_MOTION);
          }
          
          void loop()     
          {     
            // Read digital motion value
            bool tripped = digitalRead(DIGITAL_INPUT_SENSOR) == HIGH;
          
            Serial.println(tripped);
            send(msg.set(tripped?"1":"0"));  // Send tripped value to gw 
          
            // Sleep until interrupt comes in on motion sensor. Send update every two minute.
            sleep(digitalPinToInterrupt(DIGITAL_INPUT_SENSOR), CHANGE, SLEEP_TIME);
          }```
          mfalkviddM Offline
          mfalkviddM Offline
          mfalkvidd
          Mod
          wrote on last edited by mfalkvidd
          #10

          @toddsantoro where did you paste the example sketch? What is the file name and in which folder is that file? (use Sketch->Show sketch folder (ctrk/cmd+K) to locate it)

          1 Reply Last reply
          0
          • mfalkviddM mfalkvidd

            @toddsantoro something in the Arduino IDE is referencing libraries/TAS_motion_sensor. Do you have any idea what it could be? As AWI said, nothing should expect TAS_motion_sensor to be in the libraries folder.

            toddsantoroT Offline
            toddsantoroT Offline
            toddsantoro
            wrote on last edited by
            #11

            @mfalkvidd I removed everything I have done and started new so that is why you do not see that in the library's folder. I would like to know the exact steps no matter how trivial they are to setting up the sensors project. I am a web programmer and that may be my issue because I know how I would set things up but that does not mean thaty are correct in this situation.

            mfalkviddM 1 Reply Last reply
            0
            • toddsantoroT toddsantoro

              @mfalkvidd I removed everything I have done and started new so that is why you do not see that in the library's folder. I would like to know the exact steps no matter how trivial they are to setting up the sensors project. I am a web programmer and that may be my issue because I know how I would set things up but that does not mean thaty are correct in this situation.

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

              @toddsantoro the instructions are available at https://www.mysensors.org/about/arduino
              After installing the library you can open the examples from File->Examples->MySensors. There is no need to copy-paste from the build page (but that should work as well).

              toddsantoroT 1 Reply Last reply
              0
              • mfalkviddM mfalkvidd

                @toddsantoro the instructions are available at https://www.mysensors.org/about/arduino
                After installing the library you can open the examples from File->Examples->MySensors. There is no need to copy-paste from the build page (but that should work as well).

                toddsantoroT Offline
                toddsantoroT Offline
                toddsantoro
                wrote on last edited by
                #13

                @mfalkvidd OK. I will give it a try. Thanks for your help and patience. I hope to automate my whole 417 sqft home and then help others to do the same.

                toddsantoroT 1 Reply Last reply
                1
                • toddsantoroT toddsantoro

                  @mfalkvidd OK. I will give it a try. Thanks for your help and patience. I hope to automate my whole 417 sqft home and then help others to do the same.

                  toddsantoroT Offline
                  toddsantoroT Offline
                  toddsantoro
                  wrote on last edited by
                  #14

                  @toddsantoro Actually I have read that and I am still in the dark. From the Arduino GUI I go FILE > NEW. COMMAND + S and save it where? It defaults to the Arduino folder on my machine with just Libraries directory in it. Do I create a SKETCHES folder and save the project there? I just don't know what to do???

                  mfalkviddM 1 Reply Last reply
                  0
                  • toddsantoroT toddsantoro

                    @toddsantoro Actually I have read that and I am still in the dark. From the Arduino GUI I go FILE > NEW. COMMAND + S and save it where? It defaults to the Arduino folder on my machine with just Libraries directory in it. Do I create a SKETCHES folder and save the project there? I just don't know what to do???

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

                    @toddsantoro save it in the suggested directory, next to (not inside) the libraries folder.

                    toddsantoro170T 1 Reply Last reply
                    0
                    • mfalkviddM mfalkvidd

                      @toddsantoro save it in the suggested directory, next to (not inside) the libraries folder.

                      toddsantoro170T Offline
                      toddsantoro170T Offline
                      toddsantoro170
                      wrote on last edited by
                      #16

                      @mfalkvidd ok... what goes in the file? Copy paste from the example of do I somehow use the motion sensor library? I want to get a basic, best practices work flow going. Again thanks for your help.

                      mfalkviddM 1 Reply Last reply
                      0
                      • toddsantoro170T toddsantoro170

                        @mfalkvidd ok... what goes in the file? Copy paste from the example of do I somehow use the motion sensor library? I want to get a basic, best practices work flow going. Again thanks for your help.

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

                        @toddsantoro170 using the example file without modification is usually the best way to start.

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


                        13

                        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