Skip to content

An example sketch featuring the process of reading data from a FireFly sensor board and sending it to a ThingSpeak channel.

Notifications You must be signed in to change notification settings

MakerLabLjubljana/arduino-firefly-thingspeak-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

arduino-firefly-sensor-example
An example sketch featuring the process of reading data from a FireFly sensor board and sending it to a ThingSpeak channel.

Info:
An example sketch featuring the process of reading data from a FireFly(www.firefly-iot.com) sensor board and sending it to a ThingSpeak channel.

This example was created by Anže Kožar(@nzkozar) for Makerlab Ljubljana(www.maker.si) and adapted from code by L-Tek Elektronika(http://www.l-tek.si)

This example was tested on Arduino Uno and Arduino Mega ADK using a Ethernet Shield and an XBee shield.


FireFly communication functions:
  • void FFContinuousResponse(char id[3], char timeRange[1], char interval[2])
    With this message you can request data from a node and you will get sensor data as return continuously with interval you've written.

    First field of the function is ID of the node you want data from for node FF-K12 id would be K12.

    Next named timeRange id the unit of measurement you want:
    4 meaning miliseconds
    3 meaning seconds
    2 meaning minutes
    1 meaning hours

    and interval is the time interval you want
    05 would mean 5 units of measurement

    NOTE: if you pick miliseconds as timeRange 01 mean 100 miliseconds and 10 means 1 second writing 3 as timeRange and 05 as interval would mean you will get data every 5 seconds
    NOTE 1: if you want to have an interval which is described with only 1 number like 9 you have to write 0 infront due to the protocol. Mmeaning 1 would be 01 always use 2 characters.

  • void FFKillContinuous(char id[3])
    With this message you can kill continuous response from a specific FlyTag.
    Here you only write the id of the node you want to stop responding for node FF-K12 id would be K12
  • void FFRespondOnce(char id[3])
    With this message you can get data from a specific FlyTag node but you will only get it once.
    Here you only write the id of the node you want to get data from for node FF-K12 id would be K12.
  • void FFSetSensors(char id[3], int lux, int rh, int temp, int mag, int accel, int gyro)
    With this message you can turn on/off sensors on a node.

    First field of the function os id of the FlyTag node for example FF-K12 you will write K12, capital letters are important!

    Set value to 1 if you want sensor to be on 0 for it to be off.

    NOTE: Here, if the value you select specifies only humidity sensor to be turned on, any other sensor that is currently turned on, will be turned off when you send this command.

  • void FFSetOutput(char id[3], int LED1, int LED2, int LED3, int p0_15, int p0_27)
    First field of the function os id of the FlyTag node for example FF-K12 you will write K12, capital letters are important!

    Parameters you can change are:
    -LED1 //turns LED1 ON or OFF (0 means on 1 means off)
    -LED2 //turns LED2 ON or OFF (0 means on 1 means off)
    -LED3 //turns LED3 ON or OFF (0 means on 1 means off)
    -p0_15 //writes value to pin p0-15 (you can set it to 0 or 1)
    -p0_27 //writes value to pin p0-27 (you can set it to 0 or 1)

About

An example sketch featuring the process of reading data from a FireFly sensor board and sending it to a ThingSpeak channel.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages