Skip to content

Instantly share code, notes, and snippets.

View raghavendrahassy's full-sized avatar
🎯
Focusing

Gururaghavendra Hasigal raghavendrahassy

🎯
Focusing
View GitHub Profile
#include <avr/io.h>
#include <util/delay.h>
#define Segment PD0
int main() {
char seg_code[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90,0x88,0x83,0xc6,0xa1,0x86,0x8e};
int cnt;
/* Configure the ports as output */
#include <avr/io.h>
#include <util/delay.h>
#define LED PB0
#define SWITCH PC0
int main()
{
#include <avr/io.h>
#include <util/delay.h>
#define SegOne 0x01
#define SegTwo 0x02
#define SegThree 0x04
#define SegFour 0x08
#include <avr/io.h>
#include <util/delay.h>
#define Relay PA0
int main()
{
/* Configure the port A0 as Output */
DDRA = (1 << Relay);
#include<avr/io.h>
#include<avr/interrupt.h>
#define LED PD4
ISR (TIMER1_OVF_vect) // Timer1 ISR
{
PORTD ^= (1 << LED);
TCNT1 = 63974; // for 1 sec at 16 MHz
}
#include<avr/io.h>
#include<avr/interrupt.h>
#define LED PD4
ISR (TIMER1_OVF_vect) // Timer1 ISR
{
PORTD ^= (1 << LED);
TCNT1H=0xF9; // Reload the 16-bit count value
TCNT1L=0xE6; // in timer1 count registers
#include<avr/io.h>
#define LED PD4
int main()
{
DDRD=0xff; //configure PORTD as output
OCR1AH = 0x3d;
OCR1AL = 0x09;
TCCR1B = (1<<CS10) | (1<<CS12);
#include<avr/io.h>
#define LED PD4
int main()
{
uint8_t timerOverflowCount=0;
DDRD=0xff; //configure PORTD as output
TCNT0=0x00;
TCCR0 = (1<<CS00) | (1<<CS02);
#include <ESP8266WiFi.h> //https://github.com/esp8266/Arduino
//needed for library
#include <DNSServer.h>
#include <ESP8266WebServer.h>
#include <WiFiManager.h> //https://github.com/tzapu/WiFiManager
#include <WiFiClient.h>
#include <PubSubClient.h>
char* mqttserver = "128.199.72.21"; //change this to your server if required
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define OLED_RESET 4
int TIME_UNTIL_WARMUP = 50; // in seconds
unsigned long time;