roller shutter
-
hi
this is a roller shutter sketch that i wrote :) a simple sketch :)#define MY_DEBUG #define MY_RADIO_NRF24 #define MY_RF24_CHANNEL 0 #define MY_REPEATER_FEATURE #include MY_NODE_ID 20 #include <SPI.h> #include <MySensors.h> #define RELAY_1 3 #define RELAY_2 4 void before() { int sensor = 1; pinMode(RELAY_1, OUTPUT); pinMode(RELAY_2, OUTPUT); digitalWrite(RELAY_1,HIGH); digitalWrite(RELAY_2,HIGH); } void setup() { } void presentation() { sendSketchInfo("Roller shutter", "1.0"); int sensor = 1 ; present(sensor, S_COVER); } void loop() { } void receive(const MyMessage &message) { if (message.type == V_UP) { digitalWrite(RELAY_1, HIGH); delay(500); digitalWrite(RELAY_2, LOW); } if (message.type == V_STOP ) { digitalWrite(RELAY_1, HIGH); delay(500); digitalWrite(RELAY_2, HIGH); } if (message.type == V_DOWN) { digitalWrite(RELAY_2, HIGH); delay(500); digitalWrite(RELAY_1, LOW); } } -
Nice, I was wondering about something like this but couldn't think how you'd handle limits? Unless the motor handles them..
@Qu3Uk said:
Nice, I was wondering about something like this but couldn't think how you'd handle limits? Unless the motor handles them..
there is a 2channel relay and motor left round wire is connect to one relay and motor right round wire is connect to other channel.
here HIGH = off and LOW = on
for left round (right round is off and left round is on)
for right round (left round is off and right round is on)
for stop both is off
:) -
@Qu3Uk said:
Nice, I was wondering about something like this but couldn't think how you'd handle limits? Unless the motor handles them..
there is a 2channel relay and motor left round wire is connect to one relay and motor right round wire is connect to other channel.
here HIGH = off and LOW = on
for left round (right round is off and left round is on)
for right round (left round is off and right round is on)
for stop both is off
:) -
@Reza Oh I understand that but with stop command you could quite quickly have the shutter fully open but the motors still running. Right?
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login