Hardware Reference
In-Depth Information
You will receive in return some code. Just copy this code somewhere else for now, or keep
the web page open: we will need this hexadecimal code quite soon.
We are now going to see the most important points of the Arduino sketch of this section.
The code itself is given by Teleduino and is really complex, so refer to the code inside the
GitHub repository to get the complete code for this project.
The sketch starts by including the required libraries for the project:
#include <EEPROM.h>
#include <Servo.h>
#include <Wire.h>
#include <Teleduino328.h>
#include <SPI.h>
#include <Ethernet.h>
Then, you need to enter the MAC address of your Arduino Ethernet shield. You can find it
below the shield itself. Just enter it in the mac variable:
byte mac[] = { 0x90 , 0xA2 , 0xDA , 0x0E , 0xFE , 0x40 };
Later in the code, you can also paste your API key in hexadecimal format:
byte key[] = { 0x64 , 0x26 , 0xFF , 0xC9 ,
0x20 , 0x4C , 0xF2 , 0xCF ,
0xAE , 0x42 , 0xD4 , 0x1A ,
0xED , 0x6C , 0xB0 , 0xB7 };
Now, we declare the pin on which you can connect a LED to monitor the status of Teledu-
ino. I didn't use this feature for this project, but if you want to do so you can just connect
a LED to this pin:
byte statusLedPin = 8 ;
We also declare an Ethernet client, that we will use to connect to the Teleduino service:
Search WWH ::




Custom Search