Categories

Arduino esplora sound level indicator

In this example we use an Arduino Esplora nad use the on board micropone and RGB led and create a sound level project, if the sound level is an acceptable level then the RGB led will be green, if the value exceeds this level we will change the RGB led to red.

esplora

esplora

 

Code

This example uses some of the built in esplora functions, namely the readMicrophone and writeRGB ones

#include <Esplora.h>
 
void setup()
{
  Serial.begin(9600);
} 
 
void loop()
{
  int value = Esplora.readMicrophone();
  Esplora.writeRGB(0, 0, 0);
  Serial.println(value);
  if(value < 100)
  {
      Esplora.writeRGB(0, 255, 0);
      delay(100);
  }
  else
  {
      Esplora.writeRGB(255, 0, 0);
      delay(100);
  }
  delay(100);
}
Share

Esplora buzzer example

Another example for the Arduino Esplora, we will read the value from the slider and play a tone based on that from the buzzer. You can see the location of these parts in the picture of the Esplora underneath

This will probably be the shortest example you ever use on an Arduino

esplora

esplora

Code


#include <Esplora.h>

void setup()
{
}

void loop()
{
// read the slider value
int slider = Esplora.readSlider();
// play the note corresponding to the slider's position:
Esplora.tone(slider);
}

 

Links


Esplora Joystick + Sensor + LED Module Kit Board for Arduino – Deep Blue – $62.13

Share

Temperature displayed on Esplora LCD

This example will display the temperature on an LCD connected to an Arduino Esplora

esplora

esplora

Code


#include <Esplora.h>
#include <TFT.h>
#include <SPI.h>

char tempCelsius[3];
char tempFahrenheit[3];

void setup()
{
//setup the LCD
EsploraTFT.begin();
EsploraTFT.background(0,0,0);
EsploraTFT.stroke(255,255,255);
EsploraTFT.setTextSize(2);
EsploraTFT.text("Celsius",0,0);
EsploraTFT.text("Fahrenheit",0,60);
}

void loop()
{
// read the temperature sensor in Celsius, then Fahrenheit:
String celsius = String(Esplora.readTemperature(DEGREES_C));
String fahrenheit = String(Esplora.readTemperature(DEGREES_F));
celsius.toCharArray(tempCelsius, 3);
fahrenheit.toCharArray(tempFahrenheit, 3);
EsploraTFT.stroke(255,255,255);
EsploraTFT.text(tempCelsius, 0, 30);
EsploraTFT.text(tempFahrenheit, 0, 90);
// wait a second before reading again:
delay(1000);
EsploraTFT.stroke(0,0,0);
EsploraTFT.text(tempCelsius, 0, 30);
EsploraTFT.text(tempFahrenheit, 0, 90);
}

 

Links

Atmega32U4 Esplora Game Board Module Leonardo Updated Version FZ0606 Free Shipping

1.8 inch TFT LCD For Arduino Esplora

Share