Environment
Last updated
Last updated
This section explains the main features of the Waspmote IDE.
Software units written using the IDE are called sketches. These sketches are written in the text editor. Sketches are saved with the file extension ".pde".
The message area gives feedback while saving and exporting, and also displays errors. The console displays text output by the IDE including complete error messages and other information. The bottom-right corner of the window displays the current board and serial port.
This IDE allows you to manage more than one file at the same time (in the tab zone). These can be normal Waspmote code files (.pde), C files (.c extension), C++ files (.cpp), or header files (.h).
The toolbar buttons allow you to verify and upload programs, create, open, and save sketches, and open the serial monitor.
Compile: Checks your code for errors.
Upload: Compile your code and after that uploads it to the Waspmote board.
New: Creates a new sketch.
Open: Opens a menu of all the sketches in your sketchbook. Clicking on one will open it within the current window.
Save: Saves changes on your sketch.
Serial Monitor: Opens the Serial Monitor.
Additional commands are found within the five menus: File, Edit, Sketch, Tools, Help. The menus are context sensitive, which means only those items relevant to the work currently being carried out are available.
Before uploading your sketch, you need to select the correct items from the Tools → Target menu and the Tools → Serial Port menu.
On Windows, the serial port is something like COMX; to find out, you look for USB serial device in the ports section of the Windows Device Manager. On a Mac, the serial port is something similar to /dev/tty.usbserialXXX. And on Linux, it should be /dev/ttyUSBX.
Once you have selected the correct serial port and target, press the Upload button in the toolbar or select the Upload item from the File menu. Waspmote will reset automatically and begin the compile and upload process.
The IDE will display a loading bar and a message when the upload is complete, or show an error.
Libraries provide extra functionality for use in sketches. To use a library in a sketch, select it from the Sketch → Import Library menu. This will insert one or more #include
statements at the top of the sketch and compile the library with your sketch. There is a list of libraries in the reference. Some libraries are included with the Waspmote API. Others can be downloaded from a variety of sources.
Adding a third-party library: Libraries are often distributed as a zip file or folder. The name of the folder is the name of the library. Inside the folder will be a .cpp file, a .h file and often a keywords.txt file, examples folder, and other files required by the library.
To add the library, first quit the Waspmote IDE. Then uncompress the ZIP file containing the library. It should contain a folder called MyLibrary, with files like MyLibrary.cpp and MyLibrary.h inside. If the .cpp and .h files are not in a folder, you will need to create one. In this case, you have to make a folder called "MyLibrary". Drag the MyLibrary folder and drop it into the IDE libraries folder. There may be more files than just the .cpp and .h files, just make sure they are all there. Restart the IDE. Make sure the new library appears in the Sketch → Import Library menu item.
If you are not advanced user, we recommend to use only Libelium's official libraries. Other libraries can cause damages to the electronics, and their use is obviously out of the warranty scope
The Serial Monitor displays serial data being sent from the Waspmote board (via USB port) or from a Gateway unit...
Choose the baud rate from the drop-down menu that matches the rate of Waspmote (USB = 115200 bps).
For advanced use, if you need to send data to the board, enter the text and click on the 'Send' button or press enter.
Some preferences can be set in the Preferences menu (found under the Waspmote menu on the Mac, or File on Windows and Linux). The rest of the options (for example, the window size) can be found in the preferences file, whose location is shown in the preference dialog. If you want to edit this preferences file, make sure you closed the IDE before editing.
The IDE has been translated into 30+ different languages. By default, the IDE loads in the language selected by your operating system.
If you want to change the language manually, start the IDE and open the Preferences window. Next to Editor Language there is a dropdown menu with the currently supported languages. Select your preferred language from the menu, and restart the IDE to start using the selected language. If your preferred language is not supported, the IDE will default to English.