zazel1 Posted October 29, 2011 Share Posted October 29, 2011 Little help please:I have 3 car garage on C4 card access system. I would like an LED on the 6 button in the kitchen to turn orange if any of the doors are open.What is the best way to do this? Link to comment Share on other sites More sharing options...
zazel1 Posted October 30, 2011 Author Share Posted October 30, 2011 OK I used ConditionalWhen the variable Garage --> Door 1 --> RelayState Changes? If the Garage-->Door 1 is open --> Set LED:6 Current color to Orange on Kitchen-->6 Button Keypad? If the Garage-->Door 1 is closed (NEED HELP HERE)For the closed portion above I want the LED to revert back to the LED color it was before it changed to orange. Button 6 also tracks the lights in the room as well as the state of music i.e. if any of lights and/or music in the room are on then the LED is Red otherwise the LED is Blue.Without having to add each conditional for all the lights/music I want the LED to revert to its color before change to orange.What is this the best/correct way? Link to comment Share on other sites More sharing options...
zazel1 Posted November 18, 2011 Author Share Posted November 18, 2011 Ok some help requested here!Another method I suppose could be a Garage Door Boolean variable.If true when any garage door open then LED light turns Orange. Fine, but what is the best way to get the LED to revert to the original color once the Boolean is false? (i.e Garage door closed) Link to comment Share on other sites More sharing options...
thecodeman Posted November 18, 2011 Share Posted November 18, 2011 Ok some help requested here!Another method I suppose could be a Garage Door Boolean variable.If true when any garage door open then LED light turns Orange. Fine, but what is the best way to get the LED to revert to the original color once the Boolean is false? (i.e Garage door closed)You'll want it to report that all doors are closed, right? Not just one? You'll need to be able to check if all doors are closed. Link to comment Share on other sites More sharing options...
brucecampbell Posted November 21, 2011 Share Posted November 21, 2011 Create a boolean variable 'Garage_Door_Open'Have the LED colour change on the variable change eventOn each of the garage door open states, simply set this variable = trueOn each of the garage door close states, check if the other two doors are closed, if so, set variable = false. Link to comment Share on other sites More sharing options...
BrettB0727 Posted November 21, 2011 Share Posted November 21, 2011 Create a boolean variable 'Garage_Door_Open'Have the LED colour change on the variable change eventOn each of the garage door open states, simply set this variable = trueOn each of the garage door close states, check if the other two doors are closed, if so, set variable = false.Another option, since we don't have multi-conditional if statements is to use an integer. Especially for other similar situations(think windows), you would end up with a huge mess of nested if statement.Example:GarageState=0: All garages are closedGarageState=1: 1 garage door openGarageState=2: 2 garage doors openGarageState=3: 3 garage doors open...Each time a garage door opens, +1, and each time a door closes, -1. Now you also have extra details such as how many garage doors are open too. And if GarageState changes, update keypad.I do a similar thing that I call HouseState:-1 = Vacation Mode0 = All Off1 = Lights2 = EntertainmentIt makes for really simple keypad programming, as 2 buttons on every keypad are devoted to either HouseState=HouseState+1 or HouseState=HouseState-1 on release. Just 1 line per button on the keypad, and all the logic is handled in 1 location, which is when the HouseState variable changes. This allows me to go between more than just 2 states with just 2 buttons, something that wouldn't work with True/False.As far as returning to the previous color. I don't see anything in Composer that simply says something similar to "Get Color" so you just can't get the color and save it in a variable before you switch to "Open Garage Colors", BUT hopefully you have a variable that your colors are based on to begin with, and then you could do something similar to my "HouseState":If GarageState=0--- If RoomState=0, LED=Blue--- If RoomState>0, LED=RedIf GarageState>0, LED=OrangeReally simple programming that is much more scalable than True/False. Link to comment Share on other sites More sharing options...
mludwig Posted November 21, 2011 Share Posted November 21, 2011 I actually use a combination of things to do a few things:- I have the top LED on the 3 button in our mud-room (off the garage) show RED if there is a door open, BLUE if not.- If you push the top LED, the system opens one garage door and then starts a 3 minute timer - First 60 seconds, the top LED blinks GREEN - Second 60 seconds, the top LED blinks YELLOW - Third 60 seconds, the top LED blinks RED- Then the garage door closesWorks great when my kids want to leave the house and have the garage auto-close. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.