Skip to content

Instantly share code, notes, and snippets.

View mohitbhoite's full-sized avatar

Mohit Bhoite mohitbhoite

View GitHub Profile
@mohitbhoite
mohitbhoite / oled-animation.cpp
Created December 8, 2023 05:17
Running simple animations on 128x32 OLED display connected to Particle Photon
// This #include statement was automatically added by the Particle IDE.
#include "Adafruit_CCS811.h"
// This #include statement was automatically added by the Particle IDE.
#include <Adafruit_SSD1306_RK.h>
// #include <SPI.h>
// #include <Wire.h>
#include <Adafruit_GFX.h>
//SYSTEM_MODE(MANUAL);
@mohitbhoite
mohitbhoite / numitron-clock.ino
Created October 30, 2023 18:40
A numitron tube clock using the MAX7313 and an Adafruit Trinket
#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
#endif
@mohitbhoite
mohitbhoite / attiny-lander-lcd.cpp
Last active May 6, 2023 02:52
Surya 280, a solar powered temperature and humidity monitor using ATtiny85 microcontroller and BME280 sensor. Displayed on a four digit LCD.
//
// Project link: https://www.bhoite.com/sculptures/surya-280/
//
#include <TinyBME280.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
@mohitbhoite
mohitbhoite / attiny85-satellite-lcd.cpp
Last active March 16, 2024 18:59
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
@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 / tinycubesat.cpp
Last active November 2, 2023 12:48
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();
}
/*********************************************************************
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,
/* 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
#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
@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);