Arduino Esplora Basics
Oh! I didn't see you there! You must want to learn the basics of the basics of great Esplora board. Well, come in, come in. This tutorial will teach you about a couple of neat tricks you can do with your Esplora.
Parts
For this instruct able, you will need:
- Arduino Esplora
- The arduino IDE
- A great mind!!!!!! :)
Get to Know Your Esplora
The Esplora is a really cool board. It has 2 actuators and it has 11 inputs/sensors. It has a mic, a multiplexer, an accelerometer, and even a light sensor(photoresistor). This board is easier to program and operate given the fact that all of the sensors and actuators are built in. With the Arduino Uno, you have to designate pins in your sketches, which can be a bit of a pain. The Esplora is a great model for beginners. In this tutorial, the main focus is on the RGB LED and the Slide potentiometer. First, you will look at a simple Esplora sketch called Esplora Blink.
The LED
So open your Arduino Library and open the program Esplora blink. Read the side notes and everything, because they are all important. The stuff you should take from the notes is simple. You should know the simple commands, but just in case you did not get them, they go as follows:
- #include -tells which arduino board it is
- void setup(){}-setup, nothing to setup
- void loop(){}-basic loop command
- Esplora.write(-,-,-);-Tells Esplora what color to turn the LED
- Delay(-);-Adds delay
You can modify the program by changing the parameters in the Esplora.write command. That would change the color. If you change the parameter in the delay command, you could lengthen or shorten the delay.
Note:Delay time is in milliseconds, so 1000 in the Delay parameter equals 1 second.
I suggest that you tinker with the sketch and learn how to use the commands before moving on to the next step.
Slider
So, now that you know about some basic Esplora commands, I'll show you some slightly more advanced commands. Go to Arduino.cc ->Learn->Esplora->Step 7. As you can see, there is a small block of code . Read the notes next to it and copy and paste it into the IDE. This is what you should take from the notes:
- int slider=Esplora.readSlider();- Reads the slider position as a variable
- byte bright=slider/4;-converts variable reading to light
- Esplora.writeRed(bright);-applies readout to Red LED brightness
"bright" is the the variable that represents light in the program. It is a simple, yet really cool program. after you have pasted the code into the IDE, upload it to your board. Now, move the potentiometer and you should see the light change in brightness as you move it towards the joystick. Congratulations, you have completed this instructable!
You should now have a basic mastery of Esplora board! Use your knowledge wisely!