Skip to content

Instantly share code, notes, and snippets.

View mohitbhoite's full-sized avatar

Mohit Bhoite mohitbhoite

View GitHub Profile

Keybase proof

I hereby claim:

  • I am mohitbhoite on github.
  • I am mohitbhoite (https://keybase.io/mohitbhoite) on keybase.
  • I have a public key whose fingerprint is 3510 AF2A ADEE 1CAB EC43 F9CF B99C C13F 4C02 A39D

To claim this, I am signing this object:

@mohitbhoite
mohitbhoite / Pomodoro.cpp
Last active July 5, 2016 13:08
Super simple Pomodoro Timer via the Particle Internet Button!
// This #include statement was automatically added by the Particle IDE.
#include "InternetButton/InternetButton.h"
InternetButton b = InternetButton();
uint32_t workTime = 0;
uint32_t restTime = 0;
// Time definitions in milliseconds
@mohitbhoite
mohitbhoite / sand-demo.cpp
Created January 25, 2018 20:48
Modified version of Adafruit's led sand animation
#include <SPI.h>
#include <ADXL362.h>
#include <Wire.h> // For I2C communication
#include <Adafruit_IS31FL3731.h>
//#include <Adafruit_LIS3DH.h> // For accelerometer
#define DISP_ADDR 0x74 // Charlieplex FeatherWing I2C address
//#define ACCEL_ADDR 0x18 // Accelerometer I2C address
#define N_GRAINS 20 // Number of grains of sand
#define WIDTH 15 // Display width in pixels
@mohitbhoite
mohitbhoite / lightbar-controller.cpp
Created November 10, 2018 00:00
Code for controlling Neopixel strip with RGBW potentiometers using Adafruit Trinket M0
#include <Adafruit_NeoPixel.h>
int red,green,blue,white = 0;
// IMPORTANT: Set pixel COUNT, PIN and TYPE
#define PIN 4
#define NUMPIXELS 8
//Initialize the neopixel strip
Adafruit_NeoPixel strip(NUMPIXELS, PIN, NEO_RGBW + NEO_KHZ800);
#include <RTClib.h>
#include <Adafruit_DotStar.h>
#include <MAX7313.h>
#include "Wire.h"
#if defined(ARDUINO_ARCH_SAMD)
// for Zero, output on USB Serial console, remove line below if using programming port to program the Zero!
#define Serial Serial
/* Function prototypes -------------------------------------------------------*/
int tinkerDigitalRead(String pin);
int tinkerDigitalWrite(String command);
int tinkerAnalogRead(String pin);
int tinkerAnalogWrite(String command);
/* This function is called once at start up ----------------------------------*/
void setup()
{
//Setup the Tinker application here
/*********************************************************************
This is an example for our Monochrome OLEDs based on SSD1306 drivers
Pick one up today in the adafruit shop!
------> http://www.adafruit.com/category/63_98
This example is for a 128x64 size display using I2C to communicate
3 pins are required to interface (2 I2C and one reset)
Adafruit invests time and resources providing this open source code,
@mohitbhoite
mohitbhoite / tinycubesat.cpp
Last active January 31, 2025 18:46
Simple low powerLED blink pattern for the ATtiny based satellite sculpture
#include <avr/sleep.h> //Needed for sleep_mode
#include <avr/wdt.h> //Needed to enable/disable watch dog timer
void setup() {
pinMode(0, OUTPUT);// LED connected to pin 5 which is recognised as pin 0 by arduino
ADCSRA &= ~(1<<ADEN); //Disable ADC, saves ~230uA
//Power down various bits of hardware to lower power usage
set_sleep_mode(SLEEP_MODE_PWR_DOWN); //Power down everything, wake up from WDT
sleep_enable();
}
@mohitbhoite
mohitbhoite / attiny85-vu-meter.cpp
Created October 2, 2022 03:28
ATtiny85 based VU meter
/*
* ATtiny85 based VU meter
* Author: Mohit Bhoite
* Date: 01 August 2022
*
* Based on original code by Adafruit Industries. Distributed under the BSD license.
* and David Johnson-Davies - www.technoblogy.com
* CC BY 4.0 Licensed under a Creative Commons Attribution 4.0 International license:
* http://creativecommons.org/licenses/by/4.0/
*
@mohitbhoite
mohitbhoite / attiny85-satellite-lcd.cpp
Last active February 20, 2025 19:16
A solar powered temperature and humidity monitor using ATtiny85 microcontroller and SHT31 sensor. Displayed on a four digit LCD
//
// Project link: https://www.bhoite.com/sculptures/satellite-2202/
//
#include "Adafruit_SHT31.h"
//#include <TinyWireM.h>
//#include <USI_TWI_Master.h>
#include <avr/sleep.h> //Needed for sleep_mode
#include <avr/wdt.h> //Needed to enable/disable watch dog timer
//Following is the header file for the LCD module bought on ebay
//Seller link https://www.ebay.com/itm/284843842249