info:program_avr_remoteley_with_zigbee
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
info:program_avr_remoteley_with_zigbee [2008/08/16 07:11] – tomgee | info:program_avr_remoteley_with_zigbee [2008/08/16 07:20] (current) – tomgee | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== Programming Arduino Wirelessly ==== | + | ===== Programming Arduino Wirelessly ==== |
- | + | ||
The Arduino system offers an easy and open-source method for programming microcontrollers. Normally this means using a serial cable or USB cable attached directly to the microcontroller project. But what if your project is floating in a weather balloon, glued to the bottom of a swimming pool or baked into a loaf of bread? It would be great to upload code changes wirelessly, and even greater if you could do it from several kilometers away. | The Arduino system offers an easy and open-source method for programming microcontrollers. Normally this means using a serial cable or USB cable attached directly to the microcontroller project. But what if your project is floating in a weather balloon, glued to the bottom of a swimming pool or baked into a loaf of bread? It would be great to upload code changes wirelessly, and even greater if you could do it from several kilometers away. | ||
- | The following example demonstrates how to build a complete wireless solution for uploading code to a remote Arduino microcontroller using a couple of XBee radios, and a handy function for accomplishing wireless resets. | + | The following example demonstrates how to build a complete wireless solution for uploading code to a remote Arduino microcontroller using a couple of XBee radios, and a handy function for accomplishing wireless resets.\\ |
- | + | \\ | |
- | Practical Example | + | **Practical Example**\\ |
- | + | Minimum parts needed:\\ | |
- | Minimum parts needed: | + | |
* Two 5-15VDC power supplies. Radio Shack sells 4AA Battery Holders that are convenient for remote 3.3 Volt circuits. | * Two 5-15VDC power supplies. Radio Shack sells 4AA Battery Holders that are convenient for remote 3.3 Volt circuits. | ||
Line 57: | Line 54: | ||
*/ | */ | ||
- | int ledPin = 13; // LED connected to digital pin | + | |
- | | + | |
- | void setup() | + | |
+ | | ||
| | ||
| | ||
- | blinkLED(ledPin, | + | |
| | ||
| | ||
} | } | ||
- | void loop() | + | |
| | ||
Line 84: | Line 81: | ||
} | } | ||
} | } | ||
- | } | + | |
| | ||
- | void resetChip(int delayTime) { | + | |
- | /* if the project does not typically receive data, and accidental chip resets are tolerable, | + | /* if the project does not typically receive data, |
+ | * and accidental chip resets are tolerable, | ||
* this is a simple method that should work just fine. Otherwise it is recommended that the | * this is a simple method that should work just fine. Otherwise it is recommended that the | ||
* reset request string be part of a call-response sequence, be transmitted with a | * reset request string be part of a call-response sequence, be transmitted with a | ||
Line 99: | Line 97: | ||
| | ||
| | ||
- | | + | |
- | } | + | } |
| | ||
- | void blinkLED(int targetPin, int numBlinks, int blinkRate) { | + | |
// this function blinks the an LED light as many times as requested | // this function blinks the an LED light as many times as requested | ||
for (int i=0; i< | for (int i=0; i< | ||
Line 111: | Line 109: | ||
delay(blinkRate); | delay(blinkRate); | ||
} | } | ||
- | } | + | |
- | %% | ||
Once the code has been loaded, replace the Arduino microcontroller into the breadboard setup. You are now ready to upload code wirelessly! | Once the code has been loaded, replace the Arduino microcontroller into the breadboard setup. You are now ready to upload code wirelessly! | ||
Line 139: | Line 137: | ||
5. When you've got the timing right, your code will begin to upload wirelessly to the remote Arduino, and you will officially be living in a brave new world. | 5. When you've got the timing right, your code will begin to upload wirelessly to the remote Arduino, and you will officially be living in a brave new world. | ||
- | Step 5: | + | Step 5: |
Go crazy putting your PAW enabled Arduino systems into impossible places, knowing that you can still fix bugs, make improvements and try out new ideas. Make sure that your new code always includes the function which monitors for the *reset command! | Go crazy putting your PAW enabled Arduino systems into impossible places, knowing that you can still fix bugs, make improvements and try out new ideas. Make sure that your new code always includes the function which monitors for the *reset command! |
info/program_avr_remoteley_with_zigbee.1218885096.txt.gz · Last modified: 2008/08/16 07:11 by tomgee