Friday, January 29, 2016

Arduino Leonardo and Arduino Micro: A Hands-On Guide for Beginner

Arduino Leonardo and Arduino Micro: A Hands-On Guide for Beginner

Arduino Leonardo and Arduino/Genuino Micro are development boards which runs ATmega32U4. This book helps you to get started with Arduino Leonardo and Arduino/Genuino Micro development. Several case samples are provided to accelerate your learning. The following is highlight topics in this books:
* Preparing Development Environment
* Setting Up Arduino Leonardo and Arduino Micro
* Writing and Reading Digital Data
* PWM and Analog Input
* Working with I2C
* Working with SPI
* Accessing EEPROM
* Arduino Networking
* Keyboard and Mouse HID

Saturday, January 16, 2016

First look at the WeMos D1 Arduino compatible ESP8266 Wifi Board from Banggood.com

This video take a look at the WeMos D1: a Wi-Fi enabled Arduino compatible board based on the ESP8266 chip. The price of it is so tempting, less than 9$.


The board looks like an ordinary Arduino board. The dimensions and the pin layouts are exactly the same. So, this board is compatible with all the existing shields for Arduino. But don’t expect them to work at once, since the libraries available for the ESP8266 chip are few so far. The board, instead of an ATMEGA chip that standard Arduino boards use, use the impressive ESP8266 WiFi chip!

The ESP8266EX chip that the WeMos D1 board uses offers:
• A 32 bit RISC CPU running at 80MHz
• 64Kb of instruction RAM and 96Kb of data RAM
• 4MB flash memory! Yes that’s correct, 4MB!
• Wi-Fi
• 16 GPIO pins
• I2C,SPI
• I2S
• 1 ADC

--------------------
CODE OF THE PROJECT
--------------------
http://educ8s.tv/arduino-esp8266-tutorial-first-look-at-the-wemos-d1-arduino-compatible-esp8266-wifi-board/

Sunday, January 10, 2016

Arduino Music and Audio Projects

This book is for musical makers and artists who want to gain knowledge and inspiration for your own amazing creations. “Grumpy Mike” Cook, co-author of several books on the Raspberry Pi and frequent answerer of questions of the Arduino forums, brings you a fun and instructive mix and simple and complex projects to help you understand how the Arduino can work with the MIDI system to create musical instruments and manipulate sound.

In Part I you’ll find a set of projects to show you the possibilities of MIDI plus Arduino, covering both the hardware and software aspects of creating musical instruments. In Part II, you learn how to directly synthesize a wave form to create your own sounds with Arduino and concludes with another instrument project: the SpoonDuino. Finally, in Part III, you’ll learn about signal processing with the Arduino Uno and the Due ― how to create effects like delay, echo, pitch changes, and realtime backwards audio output.

If you want to learn more about how to create music, instruments, and sound effects with Arduino, then get on board for Grumpy Mike’s grand tour with Arduino Music and Sound Projects.

Friday, January 8, 2016

NodeMCU Development Workshop

NodeMCU Development Workshop

NodeMCU is the Development Kit based on ESP8266 with NodeMCU firmware. This book helps you to get started with NodeMCU v2 development. The following is highlight topic in this book:
* Preparing Development Environment
* Setting up NodeMCU
* Lua Programming Language
* GPIO Programming
* PWM and Analog Input
* Working with I2C
* UART
* SPI
* Working with OLED Display
* Connecting to a Network

Monday, January 4, 2016

Arduino for Secret Agents

Transform your tiny Arduino device into a secret agent gadget to build a range of espionage projects with this practical guide for hackers

Arduino for Secret Agents

About This Book
  • Discover the limitless possibilities of the tiny Arduino and build your own secret agent projects
  • From a fingerprint sensor to a GPS Tracker and even a robot– learn how to get more from your Arduino
  • Build nine secret agent projects using the power and simplicity of the Arduino platform
Who This Book Is For
This book is for Arduino programmers with intermediate experience of developing projects, and who want to extend their knowledge by building projects for secret agents. It would also be great for other programmers who are interested in learning about electronics and programming on the Arduino platform.

What You Will Learn
  • Get to know the full range of Arduino features so you can be creative through practical projects
  • Discover how to create a simple alarm system and a fingerprint sensor
  • Find out how to transform your Arduino into a GPS tracker
  • Use the Arduino to monitor top secret data
  • Build a complete spy robot!
  • Build a set of other spy projects such as Cloud Camera and Microphone System
In Detail
Q might have Bond's gadgets– but he doesn't have an Arduino (not yet at least). Find out how the tiny Arduino microcomputer can be used to build an impressive range of neat secret agent projects that can help you go undercover and get to grips with the cutting-edge of the world of espionage with this book, created for ardent Arduino fans and anyone new to the powerful device.

Each chapter shows you how to construct a different secret agent gadget, helping you to unlock the full potential of your Arduino and make sure you have a solution for every tricky spying situation.

You'll find out how to build everything from an alarm system to a fingerprint sensor, each project demonstrating a new feature of Arduino, so you can build your expertise as you complete each project. Learn how to open a lock with a text message, monitor top secret data remotely, and even create your own Arduino Spy Robot, Spy Microphone System, and Cloud Spy Camera This book isn't simply an instruction manual – it helps you put your knowledge into action so you can build every single project to completion.

Style and approach
This practical reference guide shows you how to build various projects with step-by-step explanations on each project, starting with the assembly of the hardware, followed by basics tests of all those hardware components and finally developing project on the hardware.

Friday, January 1, 2016

Standalone ESP8266/ESP-12 to read Adafruit IO feed

This example of Standalone ESP8266/ESP-12 show how to read Adafruit IO feed of toggle button and turn on/off on-board LED.

Adafruit IO is a IoT solution by Adafruit. It's now open beta. You can sign-up and join HERE.

Then you can create a dashboard (testOnOff) with feed of toggle button (OnOff).


Then you can program standalone ESP8266/ESP-12 to read the feed from Adafruit IO, and set on-board LED accordingly.


(As shown in the video, sometimes it cannot update!)

Adafruit MQTT Library is needed. You can install it in Arduino IDE Library Manager.


The program modified from GitGub: openhomeautomation/adafruit-io-esp8266. You have edit it with your AIO_USERNAME, AIO_KEY, and also WLAN_SSID and WLAN_PASS for your WiFi router.

The on-board LED share with Serial TX pin. So we have to end Serial and set the on-board LED as output after connected to Adafruit IO server.

AdafruitIoTestOnOff.ino
/***************************************************
 * Modified from:
 * https://github.com/openhomeautomation/adafruit-io-esp8266/tree/master/esp8266_lamp_module
 * 
 * =================================================
  Adafruit ESP8266 Lamp Controller Module
  
  Must use ESP8266 Arduino from:
    https://github.com/esp8266/Arduino
  Works great with Adafruit's Huzzah ESP board:
  ----> https://www.adafruit.com/product/2471
  Adafruit invests time and resources providing this open source code,
  please support Adafruit and open-source hardware by purchasing
  products from Adafruit!
  Written by Tony DiCola for Adafruit Industries.
  Adafruit IO example additions by Todd Treece.
  MIT license, all text above must be included in any redistribution
 ****************************************************/

// Libraries
#include <ESP8266WiFi.h>
#include "Adafruit_MQTT.h"
#include "Adafruit_MQTT_Client.h"

// WiFi parameters
#define WLAN_SSID       "testAP"
#define WLAN_PASS       "12345678"

// Adafruit IO
#define AIO_SERVER      "io.adafruit.com"
#define AIO_SERVERPORT  1883
#define AIO_USERNAME    "your AIO username"
#define AIO_KEY         "your AIO key"

// Create an ESP8266 WiFiClient class to connect to the MQTT server.
WiFiClient client;

// Store the MQTT server, client ID, username, and password in flash memory.
// This is required for using the Adafruit MQTT library.
const char MQTT_SERVER[] PROGMEM    = AIO_SERVER;
// Set a unique MQTT client ID using the AIO key + the date and time the sketch
// was compiled (so this should be unique across multiple devices for a user,
// alternatively you can manually set this to a GUID or other random value).
const char MQTT_CLIENTID[] PROGMEM  = AIO_KEY __DATE__ __TIME__;
const char MQTT_USERNAME[] PROGMEM  = AIO_USERNAME;
const char MQTT_PASSWORD[] PROGMEM  = AIO_KEY;

// Setup the MQTT client class by passing in the WiFi client and MQTT server and login details.
Adafruit_MQTT_Client mqtt(&client, MQTT_SERVER, AIO_SERVERPORT, MQTT_CLIENTID, MQTT_USERNAME, MQTT_PASSWORD);

/****************************** Feeds ***************************************/

// Setup a feed called 'OnOff' for subscribing to changes.
// Notice MQTT paths for AIO follow the form: <username>/feeds/<feedname>
const char ONOFF_FEED[] PROGMEM = AIO_USERNAME "/feeds/OnOff";
Adafruit_MQTT_Subscribe OnOff = Adafruit_MQTT_Subscribe(&mqtt, ONOFF_FEED);

/*************************** Sketch Code ************************************/

// connect to adafruit io via MQTT
void connect() {

  Serial.print(F("Connecting to Adafruit IO... "));

  int8_t ret;

  while ((ret = mqtt.connect()) != 0) {

    switch (ret) {
      case 1: Serial.println(F("Wrong protocol")); break;
      case 2: Serial.println(F("ID rejected")); break;
      case 3: Serial.println(F("Server unavail")); break;
      case 4: Serial.println(F("Bad user/pass")); break;
      case 5: Serial.println(F("Not authed")); break;
      case 6: Serial.println(F("Failed to subscribe")); break;
      default: Serial.println(F("Connection failed")); break;
    }

    if(ret >= 0)
      mqtt.disconnect();

    Serial.println(F("Retrying connection..."));
    delay(5000);

  }

  Serial.println(F("Adafruit IO Connected!"));

}

void setup() {

  Serial.begin(115200);

  Serial.println(F("Adafruit IO Example"));

  // Connect to WiFi access point.
  Serial.println(); Serial.println();
  delay(10);
  Serial.print(F("Connecting to "));
  Serial.println(WLAN_SSID);

  WiFi.begin(WLAN_SSID, WLAN_PASS);
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(F("."));
  }
  Serial.println();

  Serial.println(F("WiFi connected"));
  Serial.println(F("IP address: "));
  Serial.println(WiFi.localIP());

  // listen for events on the OnOff feed
  mqtt.subscribe(&OnOff);

  // connect to adafruit io
  connect();

  delay(500);
  //In-order to control the on-board LED,
  //have to end Serial
  Serial.end();
  // Set On-board LED to output
  pinMode(BUILTIN_LED, OUTPUT);

}

void loop() {

  Adafruit_MQTT_Subscribe *subscription;

  // ping adafruit io a few times to make sure we remain connected
  if(! mqtt.ping(3)) {
    // reconnect to adafruit io
    if(! mqtt.connected())
      connect();
  }

  // this is our 'wait for incoming subscription packets' busy subloop
  while (subscription = mqtt.readSubscription(1000)) {

    // we only care about the OnOff events
    if (subscription == &OnOff) {

      // convert mqtt ascii payload to int
      char *value = (char *)OnOff.lastread;
      //Serial.print(F("Received: "));
      //Serial.println(value);

      // Apply message to OnOff
      String message = String(value);
      message.trim();
      if (message == "ON") {
        digitalWrite(BUILTIN_LED, LOW);
        //Serial.println("On-board LED ON");
        }
      if (message == "OFF") {
        digitalWrite(BUILTIN_LED, HIGH);
        //Serial.println("On-board LED OFF");
        }

    }

  }

}