Skip to content

Instantly share code, notes, and snippets.

View prasant1010's full-sized avatar

Prasant prasant1010

View GitHub Profile
//created by prasant
//all right reserved to electronify.org
//you can copy edit or do what ever with this code
#include <Wire.h>
#include "RTClib.h"
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 13, 8, 9, 10, 11);
RTC_DS1307 RTC;
#define F_CPU 1000000UL
#include <avr/io.h>
#include <util/delay.h>
int main(void)
{
DDRC = 0xFF; // Configure PORTA as output
while(1)
{
// Glcd module connections
char GLCD_DataPort at PORTD;
sbit GLCD_CS1 at RC0_bit;
sbit GLCD_CS2 at RC1_bit;
sbit GLCD_RS at RB3_bit;
sbit GLCD_RW at RB4_bit;
sbit GLCD_EN at RB5_bit;
sbit GLCD_RST at RE2_bit;
#include <LiquidCrystal.h>
LiquidCrystal lcd(13, 12, 11, 10, 9, 8);
byte sensorPin[] = {0,1,2,3,4,5,6,7};
byte ledPin[] = {17,16,15,14}; // number of leds = numbers of sensors
const byte sensors = 8;
const byte leds=4;
int motor = A4;
int buzzer = A5;
void setup()
//created and modified by prasant
//All right reserved to electronify.org
//you can modify and share this code freely
#include <LiquidCrystal.h>
LiquidCrystal lcd(13, 12, 11, 10, 9, 8);
#define PIR_sensor 14
#define counter 7
#define m11 0
#define m12 1
// 7 SEGMENT CONNECTION
#define A 2
#define B 3
#define C 4
#define D 5
#define E 6
#define F 7
#define G 8
#define DP 9
#include <LiquidCrystal.h>
LiquidCrystal lcd(13, 12, 11, 10, 9, 8);
#define PIR_sensor 14
#define m11 0
#define m12 1
void setup()
{
lcd.begin(20, 4);
#include "Display_Utils.h"
unsigned short shifter, portb_index;
unsigned int digit, number;
unsigned short portb_array[4];
void interrupt() {
PORTA = 0; // Turn off all 7seg displays
PORTB = portb_array[portb_index]; // bring appropriate value to PORTD
PORTA = shifter; // turn on appropriate 7seg. display
/*
created by prasant
www.electronify.org
you can do what ever you want with this piece of code
*/
#include <LiquidCrystal.h>`
LiquidCrystal lcd(10, 9, 8, 7, 6, 5);
int incomingByte = 0; // for incoming serial data
const int relayPin1 = 13; // the number of the relay pin
/*
created by prasant
www.electronify.org
you can do what ever you want with this piece of code
*/
const int buttonPin1 = 14; // the number of the pushbutton pin
const int buttonPin2 = 15;
const int buttonPin3 = 16;
int buttonState1 = 0; // variable for reading the pushbutton status