Hi everyone I'm working on a project but I'm getting conflicting thoughts when I'm searching through the tutorials. I want to start with I'm completely noob at coding, I understand how to take an example and modify it for my use but when it comes to building code from scratch I'm clueless.
Here's my project in a nut shell. I have a RFID reader, 2 relays, LED strip light, micro switch, buttons and a solenoid.
Project objective
microswitch used to determine if door is open or closed. (Pretty sure using a pull down resistor and digital read is used here)
relay one activated when microswitch reads open (for this float int for digital pin high? Use if statement if digpin reads high ?)
-relay 2 activate solenoid when RFID reader reads a stored transmitter. (Once again if statement?)
-button, when held button stores a unregistered RFID chip to it's database. (No clue)
When a registered RFID signal is seen it starts the process of activating relays and microswitch determines when to turn off relays.
I need the code to run continuously. Basically this like a RFID door. When RFID is read it retracts solenoid causing door to open (spring loaded) when door opens microswitch becomes open and causes relay to turn on a set of leds. After a second solenoid turns off and isn't used again until another RFID signal is seen. LEDs stay on until microswitch determines door is closed. That's the basic project. The button would be used to program RFID tags.
I don't want anyone to do it for me that's part of the learning process but if someone can point out the recommended pathway I should use I would greatly appreciate it. I'm sure to an experienced programmer this a basic program but I am struggling big time on understanding how to make this all work.
microswitch used to determine if door is open or closed. (Pretty sure using a pull down resistor and digital read is used here)
I don't want anyone to do it for me that's part of the learning process but if someone can point out the recommended pathway I should use I would greatly appreciate it. I'm sure to an experienced programmer this a basic program but I am struggling big time on understanding how to make this all work.
Learn how to do one thing. Then learn how to do another thing.
When you have two separate things learn how to combine them into one thing.
Learn how to do the 3rd thing, then figure out, how to add the 3rd thing, to the two things that are one thing, to make three things that are one thing, and so on and so forth.
Hi thanks for the reply.
Yeah I understand how to use each component individually (by modifying the tutorial code and adapting it to my use) it's the stringing them together that I'm struggling with. Some forums/tutorials are confusing me on how to use the multiple components together. Maybe I'm just not looking at the right tutorials needed here.
Would you suggest for this project the use of if statements? I just need guidance on what I should be looking at. Typically I review the tutorial then build the same example and then start modifying the code to see how it changes. That's gotten me fairly far so far as I have no background in programming. I just haven't found an example that explains the different ways to use inputs and outputs or I don't know what to search for exactly. What I have found is much too advanced for me as far as examples goes.
Take a class i programming. Copying examples calls for reading, understanding and modifying them. That's much more difficult than writing code on Your own. Of course, simple examples are of good help but…
The coding business is not at all like choosing what milk, what meat You want and make a nice dinner.
"I just haven't found an example that explains the different ways to use inputs and outputs or I don't know what to search for exactly."
Do you have an Arduino? If so have you successfully run some of the example code (maybe starting with the "blink" example)? You actually need very little hardware wise to develop your code. Some hookup wire and a couple of jumpers, a pot for analog input testing, maybe an inexpensive Harbor Freight red multimeter for measuring analog voltages and high/low on pins, and the serial monitor. With that you can start developing your code. Get each part of the project working on its own (like making a pin high/low), then start combining them. Generally speaking you need to show some "skin in the game" before people will be interested in your project.
I haven't seen a freebie in a long time, but I do have a current coupon for the multimeter for $4, limit 4, thru 12/28/19. Like DollarTree reading glasses, having several is handy, truck, toolbox, house.
Actually I'm near sited and wear contacts for that, so when working in close I use the readers to refocus for close in work. Kind of like magnifiers. As a sidelight, 570372960066 is the coupon number for the Harbor Freight multimeter for $4, limit 4, thru 12/28/19, if one wants some. I would scan the coupon, but don't see a way to post the picture directly.