Open and close a damper


#1

do you help me with a rasph or arduino loop to open and close a damper by timing relay operation?


#2

@Massimotruglio83 can you provide a little bit more detail about your project.


#3

Let us know if we can help here @Massimotruglio83

~B


#4

I have to create an automatism. pressing a button will energize a 20 x relay. But then you have to turn it off otherwise I can not use the wall panel


#5

20 x relay :astonished: .what are you trying to do?
you can turn on/off relays with this code:

CAYENNE_IN(1)
{
  int currentValue = getValue.asInt();
  if (currentValue == 1)
  {
    //do whatever you want when button is on
    digitalWrite(4, HIGH);
  }
  else
  {
   //do whatever yo want when button is off
    digitalWrite(4, HIGH);
  }
}

next on your dashboard go to
add new > devices/widgets > custom widget > button widget and fill all details with channel 1 as selected.


#6

20 minutes of water on the lawn I have to give it … I need a timer your code just turns on and off


#7

You can use the Pulse function, see this thread Any way to get a timed button?