Friday, February 28, 2014

Arduino 1.5.6-r2

Arduino 1.5.6-r2 BETA released, with support for Arduino Yún and Arduino Due boards.

link: http://arduino.cc/en/Main/Software

Thursday, February 20, 2014

Send data from Android to Arduino Esplora in USB Host Mode

It's a exercise in my another blog "Android-er: Send Hello to Arduino from Android in USB Host Mode". The post show how to detect attached Arduino Esplora board on Android, run in USB Host Mode, and send data to it.

Flappy Bird in a Box Hack

Made with Arduino, two servo motors, reed switch, and magnets.

Thursday, February 13, 2014

Arduino Day 2014 29th March

Arduino Day is a worldwide celebration of Arduino’s first 10 years. It's 24 hours full of events, on 29th March, 2014 – both official and independent, anywhere around the world – where people interested in Arduino can meet, share their experiences, and learn more.

link: http://day.arduino.cc/



Monday, February 10, 2014

Esplora example: read temperature sensor

This example read and display temperature sensor of Arduino Esplora on TFT screen, in celsius and fahrenheit.

Read temperature sensor on Arduino Esplora
Read temperature sensor on Arduino Esplora

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

int celsius = 0;
int fahrenheit = 0;
char printoutC[3];
char printoutF[3];

void setup()
{
    EsploraTFT.begin();
    EsploraTFT.background(0,0,0);
    
    //preset dummy reading to print
    String dummy = "0";
    dummy.toCharArray(printoutC, 3);
    dummy.toCharArray(printoutC, 3);
    
    EsploraTFT.stroke(255,255,255);
    EsploraTFT.text("degree C: ", 0, 10);
    EsploraTFT.text("degree F: ", 0, 20);
} 

void loop()
{
    //read the temperature sensor
    celsius = Esplora.readTemperature(DEGREES_C);  
    fahrenheit = Esplora.readTemperature(DEGREES_F);

    //clear previous print of reading
    EsploraTFT.stroke(0,0,0);
    EsploraTFT.text(printoutC, 60, 10);
    EsploraTFT.text(printoutF, 60, 20);
    
    String(celsius).toCharArray(printoutC,3);
    String(fahrenheit).toCharArray(printoutF,3);
    EsploraTFT.stroke(255,255,255);
    EsploraTFT.text(printoutC, 60, 10);
    EsploraTFT.text(printoutF, 60, 20);

    delay(1000);
}

Monday, February 3, 2014

Example of Timer Interrupt on Arduino

It's example to use Timer Interrupt of Arduino Esplora, to toggle RGB LED when timer interrupt reached.



testTimer.ino
#include <Esplora.h>

volatile boolean ledon;
volatile unsigned long lasttime;
volatile unsigned long now;
 
void setup() {
    ledon = true;
    Esplora.writeRGB(100, 100, 100);

    lasttime = millis();
    
    // initialize Timer1
    noInterrupts(); // disable all interrupts
    TCCR1A = 0;
    TCCR1B = 0;

    TCNT1 = 34286; // preload timer 65536-16MHz/256/2Hz
    TCCR1B |= (1 << CS12); // 256 prescaler
    TIMSK1 |= (1 << TOIE1); // enable timer overflow interrupt
    interrupts(); // enable all interrupts
    
}
 
void loop() {
 
}

ISR(TIMER1_OVF_vect)
{
    TCNT1 = 34286; // preload timer
    
    ledon = !ledon;
    if(ledon){
        Esplora.writeRGB(0, 0, 1);
    }else{
        Esplora.writeRGB(0, 0, 0);
    }
    
    now = millis();
    Serial.println(now - lasttime);
    lasttime = now;
}

reference: http://blog.oscarliang.net/arduino-timer-and-interrupt-tutorial/

Saturday, February 1, 2014

Programming Arduino Uno with Simulink



Install the Arduino® support package, create a simple model, and download the model to Arduino Uno using a step-by-step workflow with Simulink®.

For more information, please visit, http://www.mathworks.com/hardware-support/arduino-simulink.html