Skip to content

Instantly share code, notes, and snippets.

View SibeeshVenu's full-sized avatar
🙂
Learning and Sharing

Sibeesh Venu SibeeshVenu

🙂
Learning and Sharing
View GitHub Profile
//Header files - Start//
#include "AZ3166WiFi.h"
#include "AzureIotHub.h"
#include "DevKitMQTTClient.h"
#include "config.h"
#include "utility.h"
#include "SystemTickCounter.h"
#include "RingBuffer.h"
#include "parson.h"
#include "EEPROMInterface.h"
//Constants and variables- Start//
enum AppState
{
APPSTATE_Init,
APPSTATE_Error,
APPSTATE_Recording
};
static AppState appstate;
// These numbers need to match the compiled ELL models.
//Configuration functions - Start//
static void initWifi()
{
Screen.print(2, "Connecting...");
if (WiFi.begin() == WL_CONNECTED)
{
IPAddress ip = WiFi.localIP();
Screen.print(1, ip.get_address());
hasWifi = true;
void setup()
{
Screen.init();
Screen.print(0, "IoT Device Demo");
Screen.print(2, "Initializing...");
Screen.print(3, " > Serial");
Serial.begin(115200);
// Initialize the WiFi module
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license.
// Interval time(ms) for sending message to IoT Hub
#define INTERVAL 5000
#define MESSAGE_MAX_LEN 256
#define TEMPERATURE_ALERT 30
void loop()
{
if (hasWifi)
{
if (messageSending && (int)(SystemTickCounterRead() - send_interval_ms) >= getInterval())
{
if (appstate != APPSTATE_Error)
{
if (dropped_frames > 0)
{
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license.
#include "HTS221Sensor.h"
#include "AzureIotHub.h"
#include "Arduino.h"
#include "parson.h"
#include <assert.h>
#include "config.h"
#include "RGB_LED.h"
{
"messageId": 119,
"decibels": 94,
"temperature": 26.4,
"humidity": 34.400002,
"pressure": 994.585693,
"accelX": -9,
"accelY": -12,
"accelZ": 993,
"magX": -156,
@SibeeshVenu
SibeeshVenu / sibicoin.js
Last active February 11, 2019 09:48
A custom Cryptocurrency Token code
pragma solidity >=0.4.22 <0.6.0;
contract owned {
address public owner;
constructor() public {
owner = msg.sender;
}
modifier onlyOwner {
npm install -g @angular/cli