There is the other meaning of "programming" which is an intellectual activity involved with developing the software that gets programmed into the program flash memory. That is a very valid meaning of the word "programming" and I think is very close to what the OP is asking. It really is programming itself, in so far as it is programming new code into the program flash memory space. I disagree: when uploading a sketch, the Arduino processor is running the bootloader program, reading in the new sketch, and programming internal flash with that new program. Not to split hairs but I think calling the Upload process "self-programming " is a bit of a stretch. If you can figure-out the logic to do that, I think you'll be on your way. Push Button-2 again to go back to the original logic. Then, every time you push Button-2 the logic is reversed, so the LED is normally on and goes off when Button-1 is pushed. Write a program where Button-1 turns the LED on when pressed, and off when the button is released. One simple thing you could do to get started is this: Have two buttons and one LED (you can use the pin-13 LED on the Arduino board). It will be easier if you develop your program using LEDs before adding the relays. Do NOT try to write the whole program at once! Start with one switch and one LED. Start simple and build (or "develop") your program. Once you understand those concepts, you'll start to understand how programs work. We can say X = 5 or RelayOne = ON, and the program will store that value (or state).Ĭonditional execution (if-statements, etc.) are how computers "make decisions".Ĭonditional execution and loops (doing things over-and-over) are the two things that make programming worthwhile. Variables "remember" their value, or the value can be changed. Pay particular attention to variables and control structures. You won't understand (or remember) everything in the Programming Reference, but you'll get an idea of what you can do (and it's not that much to read-through). Take a look at some of the examples and read-through the Programming Reference. If you need that feature, you can add it later. You only need the EEPROM if the information needs to be saved when you power-off. You are going to write the program so the Arduino's behavior changes according to the buttons that are pushed and the data that's stored. If you are serious about doing this the first thing you need to do is change your post title to "User-initiatedĮEPROM memory storage" or "sw triggered EEPROM writes" to attract forum members who know how to do that (of which I am not). I can't help you with that code but others can. Obviously you have a limited EEPROM memory but you probably wouldn't need much. Such a program is possible but I wouldn't go so far as to say it is trivial. A more accurate name would be "Variable Modify Mode" because what you are inįact doing is modifying variables used by the program. The program is always running and code never changes so I would hesitate to call it "Program mode" because you are not Whether the user input is stored when it is entered or stored after exiting program mode is up the programmer. User feedback like leds or lcd, and polls a switch to determine when to enter the user input (variable values) mode after which (by polling the EXIT switch) it exits program mode. Revolves around reads and writes to the EEPROM, based on switch presses. What you are talking about is a program that That is not a mode, it's aĬycle of tasks or events. You change the code and reload it to the arduino and at the end of the transmission the arduino resets and runs the code. Frankly the arduino route appeals to me more because there is so much else I can do with a smaller learning curve as I understand it. I know I can do it with a PIC, I've seen it done, but I know nothing about them either lol. Is this possible? There's more to what it would do then that but that's the part I'm not sure an arduino can do. You could reenter program mode at any time and change which relays are activated by which switch. If you then hit switch 1 it would turn on relays 2, 4 and 5. Basically you hit the program switch then for example switch 1, this allows you to program switch 1 so you then hit switches 2, 4 and 5 then the program switch which then saves what you did. 6 of the switches are for presets and 1 switch is to enter program mode. I have spent the past several hours learning about them so I have some idea of their capabilities, I wonder about one thing though. Let me start by saying I'm a total noob, I have never used an arduino or anything similar, I haven't purchased one yet either. Not sure if that is the best way to describe it.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |