Gregg ReynoldsMauricio ChamatPrathyusha GantiRavi Ayyagari
Published © GPL3+

Let There Be Smart Light!

A solution to identify and report city street lights that are not working and need to be repaired.

IntermediateWork in progress6 hours1,333
Let There Be Smart Light!

Things used in this project

Story

Read more

Custom parts and enclosures

Find lights malfunctioning by address

Ask Alexa if lights in an address are working uses query as a skill

Schematics

query to find when lights stay on

User asks Alexa which uses the query as a skill

Code

Code to read the light sensor and create record

C#
#include <unistd.h>
#include <iostream>
#include "grove.h"

int
main(int argc, char **argv)
{
//! [Interesting]
    // Create the light sensor object using AIO pin 0
    upm::GroveLight* light = new upm::GroveLight(0);

    // Read the input and print both the raw value and a rough lux value,
    // waiting one second between readings
    while( 1 ) {
        std::cout << light->name() << " raw value is " << light->raw_value() <<
            ", which is roughly " << light->value() << " lux" << std::endl;
        sleep(1);
    }

    // Delete the light sensor object
    delete light;
//! [Interesting]
    return 0;
}

Credits

Gregg Reynolds

Gregg Reynolds

1 project • 2 followers
I'm working with Iotivity in C, Java, and Clojure.
Mauricio Chamat

Mauricio Chamat

1 project • 1 follower
I enjoy solving problems by creating appropriate solutions and not developing a solution and waiting for a problem to solve.
Prathyusha Ganti

Prathyusha Ganti

1 project • 0 followers
Ravi Ayyagari

Ravi Ayyagari

1 project • 0 followers
Thanks to Richard Passo.

Comments