Tuesday, March 29, 2016

Understanding Data Types for variables

A data type in a programming language is a set of data with values having predefined characteristics. Examples of data types are: integer, floating point unit number, character, string, and pointer. Usually, a limited number of such data types come built into a language. The language usually specifies the range of values for a given data type, how the values are processed by the computer, and how they are stored.

In this video we well learn about the different data types you have access to in the Arduino IDE





Be sure to check out the the free Arduino Crash Course.

Saturday, March 26, 2016

Track A Car Using Tiny Arduino GPS with SD Card

This is a really cool project that was originally on Make as a GPS Cat Tracker.  Michael James, at the Programming Electronics Academy, put together an excellent 10 minute video showing you how easy it is to do this project.



Pretty cool huh?  If you enjoyed that you may also like the free Arduino Crash Course.

Friday, March 18, 2016

A great Arduino project book and site

I received a message on twitter asking if I knew how to test if a GSM Sim900 module was working.  I have not worked with that module hands on but did recall a great write up on it from a trusted source, John Boxall of http://tronixstuff.com.  I learned of John through Arduinos site under Manuals And Curriculum. His book, Arduino Workshop, was listed right along with Massimo Banzi's Getting Started With Arduino.

What impressed me most with this book is that all 65 of the projects from the book can be found on the authors website along with videos documenting his build of the project.
http://tronixstuff.com/.  Actually, each of the projects from the book are well documented on the site and has great educational content on it's own. 

In the spirit of Open Source John publishes all his stuff under "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License." allowing you to copy and redistribute the material in any medium or format long as you give credit to the original source and are not using for commercial purposes.

If you find the projects on http://tronixstuff.com/Johns site useful please consider buying his book.

Sunday, March 6, 2016

Particle Photon - The Buddy System: Publish and Subscribe

This is a demonstration of the Photons publish and subscribe features.  When the photon publishes an event to the cloud it makes that available to other devices that have subscribe to the event.  The other devices is not just limited to other photons but could also be internet connected smart phones ore web browsers.

In this example two photons are wired up to have an LED shining towards a photo resistor such that when an object comes between them the photon can detect the change on the photo resister.

The sample code in the photon documentation has each photon subscribing to the others unique event.  In the event handler the photon will check to see if the published event indicates the beam to be intact or broken.  If the beam is intact then the on board LED connected to D7 is turned off, if the beam is broken then the LED is turned on.

The main code on each photonsimply checks the status of the beam and publishes the status to the cloud.

Notice in the video how quickly the communication takes place.  To see the sample code visit the photon documentation.


Friday, March 4, 2016

A Simple LED Clock using Particle Photon

This is a simple LED clock I prototyped following Simon Monks post.

I am using a Particle Photon, a couple 4.7k resistors and a 7 Seg Display with an Adafruit I2C backpack.

The 7-segment LED backpack is obtaining it's power from the VIN pin of the Photon, which is 5 volts.  In order for the D0 (data) and D1 (clock) pins to interface with the backpack they are pulled high via 4.7k resistors through the 3V3 line.  These pullups are needed so that the Photon can drive a logic 1 on those lines.

Software

Go to http://particle.io and select the BUILD option to open the web IDE.

Create a new 'App' and call it LCD_Clock.

This project requires the SPARKTIME and ADAFRUIT-LED-BACKPACK LIBRARIES, add these by clicking the libraries button, find each of these libraries in turn and click USE THIS LIBRARY selecting your new LCD_Clock app when asked to select the app.

Now you can paste the following code into your App. Note that the includes should already be there if the libraries have been imported correctly.

You will need to change your time zone offset on the last line of setup.

That's it - the display should start as soon as the Photon resets.


#include "SparkTime/SparkTime.h"
#include "adafruit-led-backpack/adafruit-led-backpack.h"

Adafruit_7segment matrix = Adafruit_7segment();
UDP UDPClient;
SparkTime rtc;

unsigned long currentTime;
unsigned long lastTime = 0UL;
String timeStr;
int colon = false;

void setup() 
{
  matrix.begin(0x70);
  matrix.setBrightness(15);
  rtc.begin(&UDPClient, "north-america.pool.ntp.org");
  rtc.setTimeZone(0); // gmt offset
}

void loop() 
{
  currentTime = rtc.now();
  int min = rtc.minute(currentTime);  
  int hour = rtc.hour(currentTime);
  matrix.print(hour * 100 + min, DEC);
  colon = ! colon;
  matrix.drawColon(colon);
  matrix.writeDisplay();
  delay(500);
}

Check out Simons book for more experiments like this