Thursday, March 31, 2016

Getting Started with the Arduino/Genuino 101

The Arduino/Genuino 101 is a learning and development board which contains the Intel® Curie™ Module, designed to integrate the core's low power-consumption and high performance with the Arduino's ease-of-use. The 101 adds Bluetooth Low Energy capabilities and has an on-board 6-axis accelerometer/gyroscope, providing exciting opportunities for building creative projects in the connected world. More information about the technical specifications and documentation can be found on the Arduino/Genuino 101 main page.

Getting Started with the Arduino/Genuino 101


Wednesday, March 30, 2016

Run diagnosis of NodeMCU/ESP8266


To run diagnosis of NodeMCU/ESP8266, we can call the function WiFi.printDiag(Serial), pass with Serial port as the parameter, it will send the diagnostic info to Serial port.

remark: this apply on NodeMCU (suppose on other standalone ESP8266 also) with ESP8266 core for Arduino.

Example:
#include <ESP8266WiFi.h>

const char* ssid = "arduino-er";
const char* password = "12345678";
byte mac[6];

void setup() {
  Serial.begin(115200);

  Serial.print("\nRun diagnostic...\n");
  WiFi.printDiag(Serial);
  Serial.println();
  
  Serial.print("\nStart...\n");
  WiFi.macAddress(mac);
  Serial.print("MAC: ");
  Serial.print(mac[0],HEX);
  Serial.print(":");
  Serial.print(mac[1],HEX);
  Serial.print(":");
  Serial.print(mac[2],HEX);
  Serial.print(":");
  Serial.print(mac[3],HEX);
  Serial.print(":");
  Serial.print(mac[4],HEX);
  Serial.print(":");
  Serial.println(mac[5],HEX);
  Serial.println();

  WiFi.begin(ssid, password);
  Serial.print("Connecting WIFI ");
  
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
 
  Serial.println("");
  Serial.println("connected");  
  Serial.print("IP address: ");
  Serial.println(WiFi.localIP());
}

void loop() {
  // put your main code here, to run repeatedly:

}

sample output:

Tuesday, March 29, 2016

Electronics For Kids For Dummies

The easy way for kids to get started with electronics

Electronics For Kids For Dummies

If your youngster likes to tinker, "Electronics For Kids For Dummies" is here to teach them the core concepts of electronics in a fun and engaging way. Written in a language elementary-to-middle-school-aged kids can understand, it's packed with full-color photos, easy-to-follow instructions, simple examples, and 13 cool projects that will boost your child's confidence while instilling valuable electronics lessons.

Written by an experienced engineer who authored "Electronics For Dummies," this friendly guide shows children the "right" way to learn about this exciting--but potentially dangerous--field. From making their very own LED flashlight and basic radio to building a smart nightlight and making an LED blink, "Electronics For Kids For Dummies" walks young readers through 13 projects that are easy to accomplish--and, most importantly, fun! Plus, the full-color design is heavy on eye-catching graphics and the format is focused on the steps to completing a project, making it approachable for any youngster with an interest in exploring the electrifying world of electronics. Introduces kids to the basics of electronics Includes 13 projects that promote your kid's sense of achievement Features larger print to make the material less intimidating and easier to navigate Covers tools and safety measures to ensure your child's safety

Spark your child's interest in the shockingly exciting field of electronics with "Electronics For Kids For Dummies"!

Friday, March 25, 2016

Arduino and Genuino 101 Development Workshop

Arduino and Genuino 101 Development Workshop

Intel has released Intel Curie which deployed on Arduino and Genuino 101. This book helps you to get started with Arduino and Genuino 101 development using Sketch. The following is highlight topics in this book:
* Setting up Development Environment
* Sketch Programming: Digital and Analog I/O
* Working with SPI
* Working with I2C
* BLE Programming
* Working with Accelerator and Gyroscope
* Working with RTC
* Accessing EEPROM
* Working with Arduino Firmata
* Arduino Networking

Thursday, March 24, 2016

NodeMCU exercise: get my IP address

NodeMCU (ESP8266) + ESP8266 core for Arduino example to get my IP address after connected to WiFi.


#include <ESP8266WiFi.h>

const char* ssid = "your WiFi ssid";
const char* password = "xxxxxxxx";
byte mac[6];

void setup() {
  Serial.begin(115200);

  Serial.print("\nStart...\n");
  WiFi.macAddress(mac);
  Serial.print("MAC: ");
  Serial.print(mac[0],HEX);
  Serial.print(":");
  Serial.print(mac[1],HEX);
  Serial.print(":");
  Serial.print(mac[2],HEX);
  Serial.print(":");
  Serial.print(mac[3],HEX);
  Serial.print(":");
  Serial.print(mac[4],HEX);
  Serial.print(":");
  Serial.println(mac[5],HEX);
  Serial.println();
  
  WiFi.begin(ssid, password);
  Serial.print("Connecting WIFI ");
  
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
 
  Serial.println("");
  Serial.println("connected");  
  Serial.print("IP address: ");
  Serial.println(WiFi.localIP());
}

void loop() {
  // put your main code here, to run repeatedly:

}

Tuesday, March 22, 2016

Read NodeMCU MAC address using Arduino IDE with esp8266 library

With esp8266 board installed to Arduino IDE, we can program NodeMCU using Arduino IDE directly.

Here is a example to read the MAC address of NodeMCU. Because we are going to read MAC only, so no need to begin WiFi and connect to any network actually.

NodeMCU_getMAC.ino
#include <ESP8266WiFi.h>

//const char* ssid = "ssid";
//const char* password = "password";
byte mac[6];

void setup() {
  Serial.begin(9600);
  //WiFi.begin(ssid, password);

  Serial.print("\nStart...\n");
  WiFi.macAddress(mac);
  Serial.print("MAC: ");
  Serial.print(mac[0],HEX);
  Serial.print(":");
  Serial.print(mac[1],HEX);
  Serial.print(":");
  Serial.print(mac[2],HEX);
  Serial.print(":");
  Serial.print(mac[3],HEX);
  Serial.print(":");
  Serial.print(mac[4],HEX);
  Serial.print(":");
  Serial.println(mac[5],HEX);
}

void loop() {
  // put your main code here, to run repeatedly:

}


Next:
- Get my IP address

Sunday, March 20, 2016

Blink NodeMCU on-board LED using Arduino IDE with ESP8266 core for Arduino, and more examples


To program NodeMCU in Arduino IDE, we have to install esp8266 board (ESP8266 core for Arduino) to Arduino IDE.

Add Additional Board Manager URL for ESP8266 board:
> File > Preference

Add "http://arduino.esp8266.com/stable/package_esp8266com_index.json" in Additional Board Manager URLs.


Add ESP8266 board to Arduino IDE:
- Open Boards Manager in Arduino IDE
- Search "esp8266" or "NodeMCU", you will find "esp8266 by ESP8266 Community". Install it.


Test:
Once esp8266 board installed, you can find an example to blink the on-board LED.
File > Examples > ESP8266 > Blink

/*
 ESP8266 Blink by Simon Peter
 Blink the blue LED on the ESP-01 module
 This example code is in the public domain
 
 The blue LED on the ESP-01 module is connected to GPIO1 
 (which is also the TXD pin; so we cannot use Serial.print() at the same time)
 
 Note that this sketch uses LED_BUILTIN to find the pin with the internal LED
*/

void setup() {
  pinMode(LED_BUILTIN, OUTPUT);     // Initialize the LED_BUILTIN pin as an output
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(LED_BUILTIN, LOW);   // Turn the LED on (Note that LOW is the voltage level
                                    // but actually the LED is on; this is because 
                                    // it is acive low on the ESP-01)
  delay(1000);                      // Wait for a second
  digitalWrite(LED_BUILTIN, HIGH);  // Turn the LED off by making the voltage HIGH
  delay(2000);                      // Wait for two seconds (to demonstrate the active low LED)
}

You can upload it to NodeMCU, to toggle the on-board LED.


notice:
- Once the ModeMCU programmed, the original firmware will be erased. To restore the original firmware with Lua shell, you have to flash the firmware again.

Control GPIO (external IO pins) of NodeMCU (ESP8266) with ESP8266 core for Arduino

Next:
Read NodeMCU MAC address using Arduino IDE with esp8266 library
Get my IP address
Run diagnosis
NodeMCU to read analog input, A0
NodeMCU act as WiFi client to update dweet.io
Display on 128x64 I2C OLED, using Adafruit SSD1306 and GFX libraries
esp8266-OLED, another esp8266-Arduino library for I2C-OLED displays
NodeMCU/ESP8266 act as AP (Access Point) and simplest Web Server
NodeMCU/ESP8266 act as AP (Access Point) and web server to control GPIO
NodeMCU/ESP8266 implement WebSocketsServer to control RGB LED
NodeMCU/ESP8266 WebSocketsServer, load html from separate file in flash file system

Saturday, March 19, 2016

Test NodeMCU onboard LED in Lua shell

Once flashed update firmware to NodeMCU, we can test the onboard LED in Lua shell.


- Connect NodeMCU and run PuTTY to enter its Lua shell.
- Enter this code (in red) to test the onboard LED:

NodeMCU 0.9.6 build 20150704  powered by Lua 5.1.4
lua: cannot open init.lua
> gpio.mode(0, gpio.OUTPUT)
> gpio.write(0, gpio.HIGH)
> print(gpio.read(0))
1
> gpio.write(0, gpio.LOW)
> print(gpio.read(0))
0
>



This video show how to:


First run NodeMCU and flash firmware


The below videos show first run NodeMCU in Windows 10, download and flash update firmware.

This video show how to find the NodeMCU connected port, and connect it with PuTTY.


Most probably, NodeMCU ship WITHOUT update firmware. This video show how to download and flash firmware on NodeMCU. To download firmware and flasher, visit https://github.com/nodemcu, and follow the steps shown in the video.
(May be you have to press and hold the on-board FLASH button, then click the Flash button of ESP8266Flasher, once flash started, you can release on-board FLASH button.)


If everything OK, you should able to connect NodeMCU with PuTTY, and enter Lua shell.
(If NodeMCU have no response in PuTTY terminal, try to press the RST button on NodeMCU.)




Next:
Test NodeMCU onboard LED in Lua shell

Thursday, March 3, 2016

Arduino and Android using MIT app inventor 2.0: Learn in a day

Arduino and Android using MIT app inventor 2.0: Learn in a day (book for everyone from children to adults)

This book is about creating fun projects with arduino and android, this book will be very useful for people who are looking to create some cool projects and are not excellent with coding skills, This book will make anyone to create their own android and arduino project within few hours. This book will be very useful for children to create their own projects with their parents guidance. This book will cover the basics of MIT app inventor and this book needs user to have little experience with arduino on how to upload code to arduino and how to verify data's in serial monitor.

Tuesday, March 1, 2016

How to program ESP8266 in Lua: Getting started with ESP8266 (NodeMCU dev kit) in Lua

Do you want to get started with Internet of Things…

How to program ESP8266 in Lua: Getting started with ESP8266 (NodeMCU dev kit) in Lua

This book is all about getting started with Internet of Things using Nodemcu, it’s a development kit made out of ESP8266, which is a cheap Wi-Fi microcontroller, and in this book you can find How to program the Nodemcu using Lua Programming language, This book will teach you how to start with “Hello World” and ends with uploading or controlling your Sensor data’s from all over the world.

why you are still waiting for? Go ahead and enjoy the IOT ride with Nodemcu …

1ST ANNUAL ESP8266 DESIGN CONTEST

Cash price awarded for 1st 2nd and 3rd place, of $1000 $500 and $250 USD an extra $250 onto these prizes if its open hardware or open software.

Both hardware and software projects can be entered. Hardware must have ESP8266EX SoC onboard, and software projects must support the ESP8266 platforms.

- See more at: http://www.esp8266.com/viewtopic.php?f=47&t=7955#p42113