Skip to content

Instantly share code, notes, and snippets.

//Author: Vivekanand Dhakane
//updated on: 10 June 2020
#include <Wire.h>
#include <avr/pgmspace.h>
#define OLED_I2c_ADDRESS 0x3C
// registers Addresses
#define COMMAND_REG 0x80 // B1000 0000
#define DATA_REG 0x40 // B0100 0000
void print_string(String string,byte x,byte y)
{
for(int i=0; i< string.length();i++)
{
char ch = string[i];
byte x_cord = x+ i* Char_Horizontal_Columns_Required;
print_char(ch,x_cord,y);
}
void print_char(char ch, byte x_cord, byte y_cord)
{
byte ascii_to_array_index = ch - First_char_ascii_code;
int char_start_in_array = ascii_to_array_index * No_of_bytes_Char + 1;
for (byte j = x_cord; j < x_cord + Char_Horizontal_Columns_Required; j++)
{
for (byte i = y_cord; i < y_cord + Char_Verticle_Pages_Required; i++)
{
setCursor(j, i);
//Author: Vivekanand Dhakane
//updated on: 10 June 2020
#include <Wire.h>
#define OLED_I2c_ADDRESS 0x3C
// registers Addresses
#define COMMAND_REG 0x80 // B1000 0000
#define DATA_REG 0x40 // B0100 0000
// commands
@vivekanandRdhakane
vivekanandRdhakane / sending_data_to_display.ino
Last active June 20, 2020 08:18
code sniplet for displaying 16x16 matrix
for (int j = 0; j < Char_Horizontal_Columns_Required; j++) //#define Char_Horizontal_Columns_Required 16
{
for (int i = 0; i < Char_Verticle_Pages_Required; i++) //#define Char_Verticle_Pages_Required 2
{
setCursor(j,i);
writeData(data[j*Char_Verticle_Pages_Required+i]);
}
}
//Author: Vivekanand Dhakane
//updated on: 10 June 2020
#include <Wire.h>
#define OLED_I2c_ADDRESS 0x3C
// registers Addresses
#define COMMAND_REG 0x80 // B1000 0000
#define DATA_REG 0x40 // B0100 0000
// commands
//Author: Vivekanand Dhakane
//updated on: 10 June 2020
#include <Wire.h>
#define OLED_I2c_ADDRESS 0x3C
// registers Addresses
#define COMMAND_REG 0x80 // B1000 0000
#define DATA_REG 0x40 // B0100 0000
// commands
/*Author: Vivekanand Dhakane
* updated on: 16 May 2020
*/
#include "FirebaseESP8266.h"
#include <ESP8266WiFi.h>
#define FIREBASE_HOST "data-logger-5684b.firebaseio.com" //Without http:// or https:// schemes
#define FIREBASE_AUTH "28fVOXd3EYLKAWCVMEcZ121NvSvRo5USOkssEcoi"
#define WIFI_SSID "Internet"
#define WIFI_PASSWORD "41450200"
//Author: Vivekanand Dhakane
//Updated on: 28/4/2020
#include <ESP8266WiFi.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#define highest_tank 91 // distance sensor reading in cm when tank is at lowest level
#define tank_offset 19 // distance sensor reading in cm when tank is Full
#define Total_tank_capacity 930 // Total Tank capacity in litres
int tank_fill_length = highest_tank - tank_offset;
//Author: Vivekanand Dhakane
//Updated on: 28/4/2020
#include <ESP8266WiFi.h>
#define trigPin 0 //trig Pin to GPIO0
#define echoPin 2 //Echo Pin to GPIO2
int count;
////////////////
char ssid[] = "ShriRamNiwas"; // SSID of your AP