roller shutter
-
hi
this is a roller shutter sketch that i wrotea 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
-
@Reza Oh I understand that but with stop command you could quite quickly have the shutter fully open but the motors still running. Right?
-
@Qu3Uk said:
@Reza Oh I understand that but with stop command you could quite quickly have the shutter fully open but the motors still running. Right?
i dont test it yet but i think you right
Suggested Topics
-
Welcome
Announcements • 23 Mar 2014, 08:24 • hek 2 Apr 2014, 14:39 -
Alexa Fauxmo - Mysensor Bridge Gateway / BLE - Mysensors Bridge Gateway
My Project • 10 Aug 2024, 08:29 • fsgraz 10 Aug 2024, 08:29 -
Simulate Online-Recreating 'Flappy Bird' with Arduino Nano
My Project • 15 Jan 2025, 09:13 • Skylar Jones 15 Jan 2025, 09:13 -
A low cost energy meter
My Project • 25 Jan 2024, 01:03 • OldSurferDude 12 Aug 2024, 06:03 -
Long time test done with soil sensor!
My Project • 7 Jan 2025, 09:13 • Nicklas Starkel 13 Jan 2025, 09:10 -
BMP280 SPI Adafruit
My Project • 24 Aug 2016, 01:56 • Matt 23 Jan 2025, 16:25