-
Notifications
You must be signed in to change notification settings - Fork 29
First steps
- Before anything else
- Differences between Arduino and panStamp boards
- Differences between current and old panStamp APIs
These are some important steps to follow before you start using your panStamps:
-
Install Arduino 1.5 IDE. This is the only IDE compatible with our latest libraries and core files. It is also the only IDE compatible with both panStamp AVR and panStamp NRG. If you want to use your old Arduino 1.0.x IDE you can still do it but only with panStamp AVR and our older "all-in-one" Arduino library documented in our old wiki.
-
Download panStamp's Arduino files, containing sample sketches and a patch for the Arduino 1.5 IDE. This patch will add the necessary board definitions, core files and libraries to the standard IDE in order to make it compatible with panStamp's family of boards.
-
Uncompress the zip file and move the "arduino-1.5_patch" folder to the directory where Arduino-1.5 is installed. Then navigate to arduino-1.5.XX/arduino-1.5_patch/ from a terminal (console) and run install.sh or install.bat, depending whether your OS is Linux/MacOS or Windows. Your Arduino IDE is now panStamp-enabled.
-
Depending on your model of panStamp (AVR or NRG), you have to select the correct board from Tools->Boards. Then open any of the sample sketches and program your module. Each sketch is designed to provide different functionality. Some of them use the SWAP protocol and other don't. Before starting a new development, try to identify which of the available sample sketches better fits your project and try to understand the code. This wiki will try to help you along this process but you can also read our forums and post your questions to them.
Like Arduinos, panStamps include a programmable microcontroller. You can program Arduinos and panStamps from the same IDE but you still have to know the basic differences between these two architectures:
-
Arduinos are usually generic boards with a well-known pin-socket format and compatible with a long list of shields and child boards. panStamps are OEM modules with integrated low-power radio and designed to be used stand-alone or assembled onto mother boards with other sensors and/or actuators.
-
Arduinos and panStamps don't necessarily share the same position and amount of pins. There are even some differences between panStamp AVR and NRG, due to the inherent differences between microcontrollers (Atmega328p vs CC430F5137).
-
panStamps are low-current consumption boards made to last for years from simple batteries. They don't include an on-board USB front-end to save power and costs but they can be connected to panSticks or any other USB-(3.3V)UART converter.
- panStamp doesn't load HardwareSerial by default so the Serial object used to print (print, println) our packets throuch the UART is not available unless you include HardwareSerial.h in your sketch. This technique prevents panStamps from wasting resources when Serial communications are not needed.
#include "HardwareSerial.h"
Users of panStamp's old library for Arduino 1.0.x will notice some changes in the current API. This changes have been introduced in order to match the current separation between core functions and libraries. This separation lets us, for example, share a common SWAP (Simle Abstract Wireless Protocol) library for both the AVR and NRG architectures. The following are the main differences introduced:
-
The panstamp object now has access to all the low-level functions and disassociates itself from the SWAP protocol. "basicradio" is the perfect sample sketch to discover how to use this object to do simple RF communications using your own packet format and protocol.
-
There is no need to include "panstamp.h" in your project or even call panstamp.init(), unless you want to configure a different frequency than 868 MHz. In such a case, you should run one of the following options from setup():
panstamp.init(CFREQ_868);
panstamp.init(CFREQ_915);
panstamp.init(CFREQ_918);
panstamp.init(CFREQ_433);
- SWAP is now implemented as a separate library. You can load it by including "swap.h" in your project. This will automatically create an object called swap, which owns all the SWAP-related functionality.
#include "swap.h"
- The swap object, only necessary if you want to use SWAP in your project, owns some of the methods before owned by the panstamp object. These methods were transferred to swap from panstamp given their close relationship with the SWAP protocol. Any of the sample sketches using SWAP will provide a rapid insight into these changes.