Skip to content

Instantly share code, notes, and snippets.

Shirish Jadav shirish47

Block or report user

Report or block shirish47

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@shirish47
shirish47 / array_size_test.ino
Last active May 18, 2018
ESP32 RAM max array test
View array_size_test.ino
/* Author: Shirish Jadav
* Date: 2, May 2018
*
* This code shows basic TCP connection over WIFI.
* update variables ssid, pass, HOST, PORT before uploading
*/
#include <WiFi.h>
#include <WiFiMulti.h>
char* ssid = "yourWifiName"; // Your wifi access point name you want to connect to
@shirish47
shirish47 / lambdafunction.js
Created May 14, 2018
lambda reading S3 Bucket files and merging Array data from multiple files to one file and storing back to S3
View lambdafunction.js
/*
this was a part of a project where we were storing data from AWS IoT
and then triggering AWS lambda to datafiles and make them one single CSV file
So this might be useful later on.
*/
var AWS = require('aws-sdk');
var s3 = new AWS.S3();
var jsonexport = require('jsonexport');
var fs = require('fs');
@shirish47
shirish47 / Timer_test.c
Created Nov 8, 2017
how to use freeRTOS timer API's in ESP32 (basic). Needed it for stoping advertisement after some time as There is not time out functionality.
View Timer_test.c
#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "esp_log.h"
#include "freertos/timers.h"
#define TAG "TIME"
/* timer calls the function ping after interval time. xTimerCreate() takes interval in TICKs so
pdMS_TO_TICKS() converts ms interval to appropriate TICKS. pdTRUE will set timer to call periodically and if Set pdFALSE,
function is called once only */
@shirish47
shirish47 / EPD_Demo.ino
Created Feb 2, 2017
I was not able to find link to this code that I have downloaded through library manager in Energia so here it is.
View EPD_Demo.ino
/**
* Copyright (c) Pervasive Displays Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
@shirish47
shirish47 / blecentral.ino
Created May 25, 2016
BLE central multiple launch
View blecentral.ino
if(sState==NSETSERVICESTATE){
Serial.println("Going to locate service");
sState=DISCOVERINGSERVICE;
ble.gattClient().launchServiceDiscovery(chandle.connHandle, ServiceCallBack, CharacteristicCallBack, service1_uuid,chars_uuid1);
}else if(sState==FOUNDSERVICE && !ble.gattClient().isServiceDiscoveryActive()){
Serial.println(" Discovering Chars");
// if(charB1.cs==NSETCHARSTATE)
// {
// Serial.println("Searching CharB1.");
// charB1.cs=DISCOVERINGCHAR;
@shirish47
shirish47 / test.ino
Last active Mar 30, 2016
available returns true even after reading.
View test.ino
#include <nRF24L01.h>
//#include <printf.h>
#include <RF24.h>
#include <RF24_config.h>
// This is test code I am trying out using library
#include <nRF24L01.h>
//#include <printf.h>
#include <RF24.h>
#include <RF24_config.h>
@shirish47
shirish47 / myfile .ino
Created Mar 28, 2016
RF24 library trouble with available
View myfile .ino
nrf24.startListening();
Serial.println("waiting..");
unsigned long started_waiting_at =millis();
bool timeout=false;
while ( ! nrf24.available() ){ // While nothing is received
if ((millis() - started_waiting_at) > 5000 ){ // If waited longer, indicate timeout and exit while loop
timeout = true;
break;
}else
@shirish47
shirish47 / ESP8266 Sleep Test code
Last active Sep 16, 2016
ESP8266 Sleep function testing for checking power consumption
View ESP8266 Sleep Test code
/*Author:??
found at ESP8266/arduino
*/
#include <ESP8266WiFi.h>
extern "C" {
#include "user_interface.h"
}
const char* ssid = "UNICORN";
const char* password = "Un1c()rn";
@shirish47
shirish47 / EEPROM trouble in Arduino
Last active Feb 10, 2016
Some how EEPROM reading was not working.
View EEPROM trouble in Arduino
#include <EEPROM.h>
#include "EEPROM_store.h"
#define PERIODIC_PERIOD 11
#define PERIODIC_PERIOD2 12
#define CONFIG_PERIOD 13
#define CONFIG_PERIOD2 14
//state flags location
void setup() {
// put your setup code here, to run once:
@shirish47
shirish47 / gist:e48284eb0c6ff5593935
Created Jan 2, 2016
trying the sleep or standby current measurment of nrf24l01+ modules
View gist:e48284eb0c6ff5593935
/*
Copyright (C) 2011 J. Coliz <maniacbug@ymail.com>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation.
TMRh20 2014 - Updates to the library allow sleeping both in TX and RX modes:
TX Mode: The radio can be powered down (.9uA current) and the Arduino slept using the watchdog timer
RX Mode: The radio can be left in standby mode (22uA current) and the Arduino slept using an interrupt pin
You can’t perform that action at this time.