NinjaBlock
Folders and files
Name | Name | Last commit date | ||
---|---|---|---|---|
parent directory.. | ||||
NinjaBlock Emulator library using Arduino Etherten - by JP Liew 24th Oct 2012 Developed by www.ninjablocks.com based on Arduino and other Open Source libraries. This code shows how a user could use NinjaBlock's Arduino library to create their own NinjaBlock using an Arduino + Ethernet Shield to emulate a NinjaBlock thus creating their own custom devices. In this example, we create two sensor types (type 5 - button and type 11 - 433mhz receiver) and 1 type of actuator. In order to initialise the NinjaBlock library, users need to get the following from Ninja Block - email [email protected] 1. A token. 2. host - Ninja Cloud host name. Ask for a non SSL version. 3. port - Ninja Cloud host port. Ask for a non SSL version. 4. vendorID - User Vendor ID ( you could use Vendor ID 0 just to muck around first, if you apply for your own Vendor ID, you get to define and create your own device ID. 5. deviceID - ID of a device (you could use Ninja's predefined ID, or apply for a vendor ID to create your own device) 6. nodeID - This is the string serial number of your product, for example if you have an Arduino board, make up an ID for this board) 7. guid - This is the unique ID of the sensor/actuator connected to your Arduino board, for example if you have two button with device ID of 5, assigning guid 1 and 2 respectively allows them to be differentiated when they show up on the user interface. How to use this example ----------------------- 1) Collect all the above parameters from [email protected] 2) A Freetronics Etherten or an Arduino with ethernet shield is required. Digital Pin 3 and 5 are used as a sensor trigger, connect them to ground to trigger a command send to Ninja Cloud. (For a better result, please implement a debounce for these pins) 3) git clone the whole library into Arduino's library folder. 4) SelectFile, Example, NinjaBlock, SendReceiveDemo, then change the above values in the sketch. 5) Upload sketch and enjoy.