Navigation

    • Register
    • Login
    • OpenHardware.io
    • Categories
    • Recent
    • Tags
    • Popular
    1. Home
    2. Ben Andrewes
    3. Topics
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    Topics created by Ben Andrewes

    • Ben Andrewes

      custom variable to domoticz to trigger scripts then reset...
      Development • • Ben Andrewes  

      3
      0
      Votes
      3
      Posts
      1422
      Views

      Ben Andrewes

      Cheers @gohan - I solved it in the end: First tried to set as a text sensor but changing the text on a sensor doesn't trigger an event in Domoticz (or at least I couldn't make it happen). Instead I present it as a light level sensor which can be used and is hidden away on a different tab in Domoticz....
    • Ben Andrewes

      Switch with 3 settings - domoticz
      General Discussion • • Ben Andrewes  

      3
      0
      Votes
      3
      Posts
      1818
      Views

      kimot

      https://forum.mysensors.org/topic/4933/using-the-selector-switch-in-domoticz-tutorial
    • Ben Andrewes

      MultiSensor - relays, temp, hum, PIR, gesture with various controller overrides
      Development • • Ben Andrewes  

      19
      1
      Votes
      19
      Posts
      5307
      Views

      BulldogLowell

      @dbemowsk said in MultiSensor - relays, temp, hum, PIR, gesture with various controller overrides: ... I think it is best to use compiler variables. They get rid of the needless use of variable storage space, even if the sketch is small. IMHO, program variables should be used for values that may/will change in your sketch The problem with using the #define directive for a constant is that they are not strongly typed. That is, suppose you are making a comparison, you may not realize that you are comparing a signed to unsigned number. You can see this if you compile this example with verbose on: #define LIMIT 6 const unsigned int limit = 6; void setup() { int myVar = 5; if(myVar > LIMIT){}; if(myVar > limit){}; } void loop() {} in C++, it is generally preferred to use the const keyword over a #define directive; both methods will store the "variable" in FLASH, saving SRAM as you pointed out. There is (of course) a lot of discourse on this topic (see Stack Overflow). So there are benefits to using #define. A #define at the top of a program does usually get seen by the programmer (or you, later on, after a hiatus) where they/you may not notice a regular definition on a quick glance #define sort of sticks out in the crowd. Perhaps that is why you see so much of the #define directive in Arduino programming.
    • Ben Andrewes

      Controller Calibration of sensors
      Development • • Ben Andrewes  

      13
      0
      Votes
      13
      Posts
      2921
      Views

      Ben Andrewes

      Thanks @mfalkvidd - you're right, the interrupt would never be cleared until the code read the gesture. I uncommented the readGesture only to find that the code hanged at that point (think that was why I commented it out before - I'd had a beer or two). I think I really need to spend a bit of time learning about the Arduino programming language, and libraries etc as my programming knowledge is based on BASIC 30yrs ago and a bit of VBA at work. At the moment my arduino programming is just hacking stuff together and seeing if it works... Anyway I found that it was the library that IDE installed was wrong and I needed to get the library direct from Sparkfun... Now it works fine so I just need to MySensorise it...