NCD24Relay with Particle photon

Hi all, I’m looking to program a NCD 24 Relay board using Particle.

Disclaimer: I’m very new to programming so forgive me for my poor use of technical language or posting location.

I hope to achieve the following;

  • All relays off;
    then
  • TurnOnRelay 1
    then
  • TurnOnRelay 7; for 13500 secs
    then
  • TurnOffRelay 7; for 13500 secs
    then
    -TurnOnRelay 7; for 300 secs
    then
  • TurnOffRelay 1 and 7;
    all relays off

So on and so forth for predetermined pairs of relays up until relay 24.

Note: the above only includes state changes. I want to keep relay 1 on for the duration of the sequence up until 1 and 7 are turned off.

Not sure if the delay() function is the correct syntax for this purpose or if some sort of timer would be better?

If someone could guide me in the right direction or provide a snippet of code to get me started that would be excellent.

NCD provides some samples for their devices and you should get the basics about how-to control them there


And they have that library also available in Web IDE
https://build.particle.io/libs/NCD24Relay/0.0.4/tab/example/Loop_Test.cpp

As for the timing, I’d definetly go for timers rather than delay().

1 Like