Monday, April 21, 2014

Introducing the Trinket

Trinket is a small tiny microcontroller board, built around the Atmel ATtiny85, a little chip with a lot of power, lowest-cost arduino-IDE programmable board!

Saturday, April 12, 2014

Example of using SimpleTimer Library for Arduino



This example show how to use the SimpleTimer Library for Arduino on Arduino Due to trigger a callback function in every 500ms, to toggle LED and send somethinf to Serial port. SimpleTimer is simple library to launch timed actions. Before you can use the library, you have to install it in your sketchbook/libraries folder, read Installation.

#include <SimpleTimer.h>

int led = 13;

SimpleTimer simpleTimer;
boolean ledon;
unsigned long lasttime;
unsigned long now;

void setup() {
    pinMode(led, OUTPUT);
    Serial.begin(9600);
    simpleTimer.setInterval(500, callback_SimpleTimer);
    lasttime = millis();
}

void loop() {
    simpleTimer.run();
}

void callback_SimpleTimer(){
    now = millis();
    digitalWrite(led, ledon = !ledon);
    Serial.println(now - lasttime);
    lasttime = now;
}

Thursday, April 10, 2014

Arduino Esplora example: read bmp from SD Card, display on TFT screen

Example of Arduino Esplora, read bmp from AD Card, and display on TFT screen.

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

// SD Chip Select pin
#define SD_CS    8

// this variable represents the image to be drawn on screen
PImage image;
int prvSwitch1, prvSwitch2, prvSwitch3, prvSwitch4;

void setup() {
  Esplora.writeRGB(255, 255, 255);
  
  EsploraTFT.begin();
  EsploraTFT.background(0, 0, 0);
  EsploraTFT.stroke(255,255,255);
  
  // initialize the serial port
  Serial.begin(9600);
  while (!Serial) {
    // wait for serial line to be ready
  }

  // try to access the SD card
  Serial.print("Initializing SD card...");
  EsploraTFT.text("Initializing SD card...", 0, 10);
  if (!SD.begin(SD_CS)) {
    Serial.println("failed!");
    EsploraTFT.text("failed!", 0, 10);
    return;
  }
  Serial.println("OK!");
  EsploraTFT.text("OK!", 0, 10);

  image = EsploraTFT.loadImage("arduino.bmp");

  if (image.isValid() != true) {
    Serial.println("error while loading arduino.bmp");
    EsploraTFT.text("error while loading arduino.bmp", 0, 10);
  }
  
  Esplora.writeRGB(0, 0, 0);
  EsploraTFT.background(0, 0, 0);
  Serial.println("started");
  EsploraTFT.text("started", 0, 10);

}

void loop(){
  int sw = Esplora.readButton(SWITCH_1);
  if(sw != prvSwitch1){
    prvSwitch1 = sw;
    if(sw == LOW){
      Esplora.writeRGB(255, 255, 255);
      Serial.println("Switch1 pressed");
      EsploraTFT.image(image, 0, 0);
      Esplora.writeRGB(0, 0, 0);
    }
  }
  
  sw = Esplora.readButton(SWITCH_2);
  if(sw != prvSwitch2){
    prvSwitch2 = sw;
    if(sw == LOW){
      Esplora.writeRGB(255, 255, 255);
      Serial.println("Switch2 pressed");
      EsploraTFT.background(255, 0, 0);
      Esplora.writeRGB(0, 0, 0);
    }
  }
  
  sw = Esplora.readButton(SWITCH_3);
  if(sw != prvSwitch3){
    prvSwitch3 = sw;
    if(sw == LOW){
      Esplora.writeRGB(255, 255, 255);
      Serial.println("Switch3 pressed");
      EsploraTFT.background(0, 255, 0);
      Esplora.writeRGB(0, 0, 0);
    }
  }
  
  sw = Esplora.readButton(SWITCH_4);
  if(sw != prvSwitch4){
    prvSwitch4 = sw;
    if(sw == LOW){
      Esplora.writeRGB(255, 255, 255);
      Serial.println("Switch4 pressed");
      EsploraTFT.background(0, 0, 255);
      Esplora.writeRGB(0, 0, 0);
    }
  }
  
}

Sunday, April 6, 2014

Tetris Skyscraper Philly Tech Week Cira Centre Building Game Spectacular


Tetris Skyscraper Philly Tech Week Cira Centre Building Game Spectacular. The spectacle kicked off a citywide series of events called Philly Tech Week. It also celebrated the upcoming 30th anniversary of a game revered as the epitome of elegance and simplicity, said Frank Lee, an associate professor of digital media at Drexel University.

Lee, a game designer who oversaw creation of the giant display, said putting it on an office building was like making a huge virtual campfire.

"This project began as a personal love letter to the games that I loved when I was a child - Pong last year, Tetris this year. But it ended up as a way of uniting the city of Philadelphia," Lee told the crowd.

Lee already holds the Guinness World Record for the world's largest architectural video game display for playing Pong on one side of the Cira Centre last year. Pong, the granddaddy of all video games, is an electronic version of paddleball developed by Atari in 1972.

Tetris, created by Russian computer programmer Alexey Pajitnov in 1984, challenges players to rotate and arrange falling shapes into complete rows.

It became a global phenomenon in the late 1980s after game designer Henk Rogers, who had seen Tetris at a trade show in Las Vegas, acquired the rights and struck a deal to put it on Nintendo's original Game Boy.

Rogers, who was among the players on Saturday in Philadelphia, said he can't believe the longevity of Tetris, which decades later continues to mesmerize players on more than 30 platforms.

"If a game lasts a year, that's amazing," said Rogers, now managing director of The Tetris Co. "They usually go out of style very quickly."

Rogers said several new Tetris products and initiatives are planned for release around its June 6 anniversary. He declined to discuss details.

Thursday, April 3, 2014

Make: Basic Arduino Projects: 26 Experiments with Microcontrollers and Electronics


Make: Basic Arduino Projects: 26 Experiments with Microcontrollers and Electronics

This companion book to MakerShed's Ultimate Arduino Microcontroller Pack provides 26 clearly explained projects that you can build with this top-selling kit right away--including multicolor flashing lights, timers, tools for testing circuits, sound effects, motor control, and sensor devices.

With the Ultimate Arduino Microcontroller Pack, you'll find everything from common components such as resistors and capacitors to specialized sensors and actuators like force-sensing resistors and motors. The kit also features the Arduino Uno Microcontroller and a MakerShield, the definitive prototyping shield for Arduino.
  • Build 26 cool mini Arduino projects and gadgets
  • Work on projects that are both instructive and have practical application
  • Get circuit diagrams and detailed instructions for building each project
  • Understand circuit design and simulation with easy-to-use tools