when Arduino is not connected to workstation

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
antennaboy
 
Posts: 22
Joined: Thu Apr 12, 2012 9:04 am

when Arduino is not connected to workstation

Post by antennaboy »

After a program is written in the Arduino IDE and saved on the workstation, the program can then be loaded in the memory of the Arduino board. Can only one program at a time be loaded? The uploaded program is the only one that gets executed.

If the Arduino board is supposed to operate independently from the workstation (sensing application) the Arduino needs its own power supply (battery). What about running the program? Is the program permanently stored in the memory on the Arduino board? For example, imagine we wanted to build a temperature sensor that starts beeping when a certain temperature is reached. We need the temperature sensor connected via some circuitry to the Arduino input interface. A program must be run all the time (in a forever loop) to monitor the temperature, follow the instructions and do something when the target T is reached. How will that program be executed if the workstation is not connected to the board?

Thanks,
Antennaboy

User avatar
Franklin97355
 
Posts: 23940
Joined: Mon Apr 21, 2008 2:33 pm

Re: when Arduino is not connected to workstation

Post by Franklin97355 »

Once a program is loaded to the Arduino it will run whenever there is power. The two sections of an Arduino program (sketch) are the setup() which runs once when the Arduino is started or reset and loop() which runs over until the power is removed or the Arduino is reset. The sensors and signal need to be compatable with the Arduino and connected to pins so the Arduino can read and control them. http://playground.arduino.cc/Learning/Standalone

User avatar
antennaboy
 
Posts: 22
Joined: Thu Apr 12, 2012 9:04 am

Re: when Arduino is not connected to workstation

Post by antennaboy »

Thank you Franklin97335.

So, in a standalone Arduino scenario, for a sensing application, the program that controls the sensor is stored in the Arduino memory on the board and is the last program that was uploaded via the workstation.

If the reset button on the Arduino board was accidentally pressed, the program would have to be re-loaded in the Arduino.

Thanks,
Antennaboy

User avatar
Franklin97355
 
Posts: 23940
Joined: Mon Apr 21, 2008 2:33 pm

Re: when Arduino is not connected to workstation

Post by Franklin97355 »

If the reset button on the Arduino board was accidentally pressed, the program would have to be re-loaded in the Arduino.
No, the program would start over from the beginning.

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”