Skip to content

Development

Discuss Arduino programming, library tips, share example sketches and post your general programming questions.
1.5k Topics 13.5k Posts

Subcategories


  • 56 578
    56 Topics
    578 Posts
    HJ_SKH
    Hi2All! Surprising is here. After about 24hours I refresh HA and suddenly my motion sensor was integrated. There is also second entity > battery : 0 , have to look deeper into that for understanding. Need to change little in the sketch, because don't want every short time 'no movement' so only when there is motion and maybe once a hour indication sensor is alive. Meantime I found 3 other good threats: https://forum.mysensors.org/topic/11200/finally-progress-evidence-based-radio-testing-method-and-capacitors https://forum.mysensors.org/topic/1664/which-are-the-best-nrf24l01-modules/27 https://forum.mysensors.org/topic/9550/build-a-reliable-power-supply-chain Very usefull for me also finally progress because of lacking time in the past. Great jobs are done here! Thanks for this all of you guys or girls!
  • How fast is a (void) loop?

    4
    0 Votes
    4 Posts
    2k Views
    petewillP
    @Meister_Petz I use millis() for this exact thing and it has been working great for me for months. Here is an example of what I do: unsigned long DHTPreviousMillis = 0; // last time update. long DHTDelay = 120000; // interval at which to do something (milliseconds) //Delay temperature and humidity for the length of time of DHTDelay without stopping the whole program unsigned long DHTCurrentMillis = millis(); if(DHTCurrentMillis - DHTPreviousMillis > DHTDelay) { DHTPreviousMillis = DHTCurrentMillis; //do something here } See http://stackoverflow.com/questions/10773425/performing-a-function-after-x-time for more details on Millis delay Hope that helps.
  • Multiple interuppts: One Arduino with two door sensors?

    interrupt door sensors
    28
    0 Votes
    28 Posts
    21k Views
    Paul AugustoP
    2 part video showing how to tie the TP4056 and MAX17043 boards together and to an arduino pro mini. Part 1: https://www.youtube.com/watch?v=3yHRrPDczK4 Part 2: https://www.youtube.com/watch?v=ZtkIDwkrc6E
  • Sensor taking the status of a blinking led of an alarm system

    19
    0 Votes
    19 Posts
    6k Views
    M
    Nano - so VIN! Thanks!
  • Software serial Library

    2
    0 Votes
    2 Posts
    2k Views
    A
    I get the same error when using the SoftwareSerial library. More specific, it is a known limitation that you cannot use SoftwareSerial.h and PinChangeInt.h together without altering one or another. Let me give you an example, I was in the same case as you are now, I wanted to use an RF ID reader (125 kHz - RDM6300) on a software serial pin, in my case was A2 (don't ask why, this was the only input pin that I have on an UNO, it is stuffed with keyboard, display, motor actuator for door opening, button for manual door opening, ringer button and NRF24 - this is my all in one entrance sensor :) ). So, what you have to do: pin A2 is on Port C you have to disable in the SoftwareSerial.h the other intrerupts, except the one associated to PortC, that would be - PCINT1 is for Port C : PCINT0 is for Port B PCINT2 is for Port D PCINT3 - it is not the case of 328P so you can leave it uncommented so in SoftwareSerial.h comment the following for PCINT0 and 2: #if defined(PCINT0_vect) ISR(PCINT0_vect) { ReceiveOnlySoftwareSerial::handle_interrupt(); } #endif The other thing that you have to do now is to tell PinChangeInt.h that you use Port C for other purpose. To do this, in MyGateway.cpp, ahead of the #include "utility/PinChangeInt.h" you should include the following: #define NO_PORTC_PINCHANGES Save, upload, enjoy... And don't forget to modify back what you altered. This assumes that you don't use intrerupts on pins...
  • Barometric Pressure Sensor Using MS5637

    23
    0 Votes
    23 Posts
    9k Views
    M
    I did delete it but understand now why I shouldn't have. I will re-add it (different device id) and let you know. It may take a little while as I am waiting for some radios with external antennas and an finding in the meantime that my radio reception is too limited to proceed.
  • Inclusion Mode

    4
    0 Votes
    4 Posts
    6k Views
    JohnJ
    @ericvdb (Vera guess) When given a fixed id enable inclusion mode so the device is found when you want to add it. If you are done you have to clear the eeprom and remove the fixed id from the code, and remove the device from the controller. After the above done, enable inclusion mode again and let the auto id assignment do it's work.
  • Node Child and MQTT Subscribe

    child sub subscribe mqtt
    7
    0 Votes
    7 Posts
    3k Views
    DammeD
    I have been away for a while but it seams quite some of you are experiencing problems, I'll try to take a look at it. If you find any more details, please let me know!
  • Problem compiling mqtt gateway

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • Serial Gateway Display

    1
    0 Votes
    1 Posts
    798 Views
    No one has replied
  • 0 Votes
    2 Posts
    837 Views
    hekH
    Could be a bit time consuming to build your own controller. But probably more fun and you'll learn a lot in the process. :)
  • 0 Votes
    4 Posts
    4k Views
    V
    I built a trip wire for the post box that I'm connecting. It's however based on a mercury tilt sensor so I'm really not sure whether I think it's a great idea putting it to use (at least not with a sturdy case...). However, I can share my code: #define DIGITAL_INPUT_SENSOR 2 // The digital input you attached your motion sensor. (Only 2 and 3 generates interrupt!) #define INTERRUPT DIGITAL_INPUT_SENSOR-2 // Usually the interrupt = pin -2 (on uno/nano anyway) MyMessage msgTripped(CHILD_ID_TRIPPED, V_TRIPPED); void setup() { gw.sendSketchInfo("Postal", "1.0"); gw.present(CHILD_ID_TRIPPED, S_MOTION); pinMode(DIGITAL_INPUT_SENSOR, INPUT); // sets the motion sensor digital pin as input } void loop() { boolean tripped = digitalRead(DIGITAL_INPUT_SENSOR) == LOW; if(tripped) { gw.send(msgTripped.set("1")); // Send tripped value to gw } gw.sleep(INTERRUPT,FALLING, SLEEP_TIME); }
  • Send time request over arduino "monitor serial"

    14
    0 Votes
    14 Posts
    4k Views
    ch3b7C
    HERE my source code my-sensors-controller-net
  • Some help to port MySensors to PCDUINO?

    pcduino
    5
    0 Votes
    5 Posts
    2k Views
    M
    thank you! i will have a look to raspberry code.
  • Sensor ACK responses

    3
    0 Votes
    3 Posts
    2k Views
    B
    Thank you for the quick response, I will have to look that over and see if I can implement it into openhab or if anyone else has done it. So far my desk looks like a mad scientists lab with arduino parts and sensors scattered about. I do have to say I am having a blast so far digging into the code and playing with hardware.
  • Energy pulse sensor + outside temp sensor

    1
    0 Votes
    1 Posts
    419 Views
    No one has replied
  • WTShare Serial Gateway Auto ID

    serial gatewayc
    1
    1 Votes
    1 Posts
    789 Views
    No one has replied
  • Is there anything stored on Gateway's EEPROM? Include sensor issue.

    13
    0 Votes
    13 Posts
    5k Views
    BulldogLowellB
    @m26872 kind of averse to using blocking code that way... I have used delay() in my setup() functions like that... for the first time I set up the devices.... The caps are really there for the day-to-day reliability of the radio. It is a power hungry little bugger. You could also do something like this so that you didn't have the delays there once you had the devices set up in vera... //... #define FIRST_TIME_SETUP //... //... #ifdef FIRST_TIME_SETUP #define SETUP_DELAY 500 #else #define SETUP_DELAY 0 #endif void setup() { delay(SETUP_DELAY); gw.begin(... delay(SETUP_DELAY); gw.sendSketchInfo(... delay(SETUP_DELAY); gw.present(... delay(SETUP_DELAY); } void loop() { }
  • [NOOB] so, do I undestand correctly what this does?

    2
    0 Votes
    2 Posts
    852 Views
    RJ_MakeR
    Have you looked here ? Just follow the arrows though the information and then come back here with any thing you don't understand.
  • Node/sensor id process

    10
    0 Votes
    10 Posts
    3k Views
    Dan S.D
    @hek Got it. Thanks. Hadn't thought of that.
  • AC 230V energy meter

    1
    0 Votes
    1 Posts
    982 Views
    No one has replied

20

Online

11.7k

Users

11.2k

Topics

113.0k

Posts