SlideShare a Scribd company logo
1 of 8
APPENDIX 1
/*
* bluetooth/Lcd/rkg.c
* Created: 4/6/2015 4:30:08 PM
* Author: Shashi Verma
*/
#include<avr/io.h>
#include<util/delay.h>
#define lcd PORTB
#define rs PB0
#define rw PB1
#define en PB2
void lcd_cmd(unsigned char com);
void lcd_data(unsigned char data);
void lcd_string(unsigned char *str);
//------------------------------------------------------------------------
void USARTInit(uint16_t ubrr_value)
{
UBRRL = ubrr_value;
UBRRH = (ubrr_value>>8);
UCSRC|=(1<<URSEL)|(1<<UCSZ1)|(1<<UCSZ0);
UCSRB|=(1<<RXEN)|(1<<TXEN)|(1<<RXCIE);
}
unsigned char USARTReadChar()
{
while(!(UCSRA & (1<<RXC)));
return UDR;
}
void USARTWriteChar(char data)
{
while(!(UCSRA & (1<<UDRE)));
UDR=data;
}
void USART_StringTransmit(unsigned char s[])
{
int i=0;
while(s[i]!='0')
{
USARTWriteChar(s[i]);
i++;
}
}
void main()
{
int x;
DDRB=0xFF;
DDRC=0xFF;
char Recieved_command;
_delay_ms(50);
USARTInit(51);
lcd_cmd(0x02);//home location
lcd_cmd(0x28);//2x16 lcd 4bit mode
lcd_cmd(0x0C);//dispy on cursor blink
lcd_cmd(0x06);//increament
while(1)
{
Recieved_command=USARTReadChar();
if(Recieved_command=='1')
{
USART_StringTransmit("n Light On 1 ");
PORTC=0b00000001;
lcd_cmd(0xc0);
lcd_string(" Light On 1 ");
}
else if(Recieved_command=='2')
{
USART_StringTransmit("n Light On 2 ");
PORTC=0b00000010;
lcd_cmd(0xc0);
lcd_string(" Light On 2 ");
}
else if(Recieved_command=='3')
{
USART_StringTransmit("n Fan On ");
PORTC=0b00000100;
lcd_cmd(0xc0);
lcd_string(" Fan On ");
}
else if(Recieved_command=='4')
{
USART_StringTransmit("n Both Light On");
PORTC=0b00000011;
lcd_cmd(0xc0);
lcd_string(" Both Light On ");
}
else if(Recieved_command=='5')
{
USART_StringTransmit("n Light 1 & Fan On");
PORTC=0b00000101;
lcd_cmd(0xc0);
lcd_string("Light 1 & Fan On ");
}
if(Recieved_command=='6')
{
USART_StringTransmit("n Light 2 & Fan On ");
PORTC=0b00000110;
lcd_cmd(0xc0);
lcd_string("Light 2 & Fan On ");
}
else if(Recieved_command=='7')
{
USART_StringTransmit("n All Device On!!");
PORTC=0b00000111;
lcd_cmd(0xc0);
lcd_string(" All Device On !!
}
else if(Recieved_command=='8')
{
USART_StringTransmit("n Shut Down !! ");
PORTC=0b00000000;
lcd_cmd(0xc0);
lcd_string(" Shut Down !! ")
}
}
}
void lcd_cmd(unsigned char com)
{
//for command rs=0,rw=0,en=1,en=0
char cmd1;
cmd1=(com&(0xF0));//upper 4 bit data
lcd=cmd1;
lcd&=~(1<<rs);//rs=0
lcd&=~(1<<rw);//rw=0
lcd|=(1<<en);//en=1
_delay_ms(5);
lcd&=~(1<<en);
cmd1=((com<<4)&(0xF0));// Lower 4 bit data
lcd=cmd1;
lcd&=~(1<<rs);//rs=0
lcd&=~(1<<rw);//rw=0
lcd|=(1<<en);//en=1
_delay_ms(5);
lcd&=~(1<<en);
}
void lcd_data(unsigned char data)
{
unsigned char data1;
data1=(data&(0xF0));// upper 4 bit
lcd=data1;
lcd|=(1<<rs); //rs=1
lcd&=~(1<<rw);//rw=0
lcd|=(1<<en);//en=1
_delay_ms(1);
lcd&=~(1<<en);//en=0
data1=((data<<4)&(0xF0));//lower 4 bit data
lcd=data1;
lcd|=(1<<rs);//rs=1
lcd&=~(1<<rw);//rw=0
lcd|=(1<<en);//en=1
_delay_ms(1);
lcd&=~(1<<en);
}
//--------------------------------------------------------------
void lcd_string(unsigned char *str)
{
int i=0;
while(str[i]!='0')
{
lcd_data(str[i]);
i++;
}
}
APPENDIX
/*
* home_automatio_RKGEC.c
* Created: 3/21/2015 7:49:00 AM
* Author: Shashi
*/
#include <avr/io.h>
#include<util/delay.h>
int main(void)
{
// DDRA=0XFF
DDRB=0x00;
DDRC=0xFF;
while(1)
{
if(PINB==0b00000001)
{
PORTC=0b00000001;
}
if(PINB==0b00000010)
{
PORTC=0b00000010;
}
if(PINB==0b00000011)
{
PORTC=0b00000100;
}
if(PINB==0b00000100)
{
PORTC=0b00000011;
}
if(PINB==0b000000101)
{
PORTC=0b00000101;
}
if(PINB==0b00000110)
{
PORTC=0b00000110;
}
if(PINB==0b00000111)
{
PORTC=0b00000111;
}
if(PINB==0b00001000)
{
PORTC=0b00000000;
}
{
PORTA=0b00000100;
_delay_ms(3600000);
PORTA=0b00000000;
_delay_ms(39600000);
}
}
}

More Related Content

What's hot

516th VTC Bldg. 520 Diagram 4-21-14
516th VTC Bldg. 520 Diagram 4-21-14516th VTC Bldg. 520 Diagram 4-21-14
516th VTC Bldg. 520 Diagram 4-21-14Doug Blagriff
 
Edu ciaa-nxp pinout-a4_v4r3_es
Edu ciaa-nxp pinout-a4_v4r3_esEdu ciaa-nxp pinout-a4_v4r3_es
Edu ciaa-nxp pinout-a4_v4r3_esJuan Barón
 
How to configure EIGRP on a Cisco router
How to configure EIGRP on a Cisco routerHow to configure EIGRP on a Cisco router
How to configure EIGRP on a Cisco routertcpipguru
 
Manual usuario - Inspur cx-h81-m1 v2 0
Manual usuario  - Inspur cx-h81-m1 v2 0Manual usuario  - Inspur cx-h81-m1 v2 0
Manual usuario - Inspur cx-h81-m1 v2 0Pablo J. Rodriguez H.
 
74ALVT162245DGG:11- Componentschip.com
74ALVT162245DGG:11- Componentschip.com74ALVT162245DGG:11- Componentschip.com
74ALVT162245DGG:11- Componentschip.comKenny Choi
 
ARM Polyglot Shellcode - HITB2019AMS
ARM Polyglot Shellcode - HITB2019AMSARM Polyglot Shellcode - HITB2019AMS
ARM Polyglot Shellcode - HITB2019AMSSaumil Shah
 
Uart VHDL RTL design tutorial
Uart VHDL RTL design tutorialUart VHDL RTL design tutorial
Uart VHDL RTL design tutorialNabil Chouba
 
Senior Design - Remote Handler Device&quot;
Senior Design - Remote Handler Device&quot;Senior Design - Remote Handler Device&quot;
Senior Design - Remote Handler Device&quot;sgarc042
 
ハイパフォーマンスブラウザネットワーキング2
ハイパフォーマンスブラウザネットワーキング2ハイパフォーマンスブラウザネットワーキング2
ハイパフォーマンスブラウザネットワーキング2Shuya Osaki
 
0.47 inch LCD Micro Dispalay 800x600 Resolution RGB Interface LCD Screen
0.47 inch LCD Micro Dispalay 800x600 Resolution RGB Interface LCD Screen0.47 inch LCD Micro Dispalay 800x600 Resolution RGB Interface LCD Screen
0.47 inch LCD Micro Dispalay 800x600 Resolution RGB Interface LCD ScreenShawn Lee
 
An introduction to Hubot - CloudConf 2015 - Turin Italy
An introduction to Hubot - CloudConf 2015 - Turin ItalyAn introduction to Hubot - CloudConf 2015 - Turin Italy
An introduction to Hubot - CloudConf 2015 - Turin ItalyCorley S.r.l.
 
New microsoft office power point presentation
New microsoft office power point presentationNew microsoft office power point presentation
New microsoft office power point presentationhnod
 
ADS-B, AIS, APRS cheatsheet
ADS-B, AIS, APRS cheatsheetADS-B, AIS, APRS cheatsheet
ADS-B, AIS, APRS cheatsheetNaoto MATSUMOTO
 
AWS ロボを作ろう JAWSUG Kobe
AWS ロボを作ろう JAWSUG KobeAWS ロボを作ろう JAWSUG Kobe
AWS ロボを作ろう JAWSUG Kobe崇之 清水
 

What's hot (20)

516th VTC Bldg. 520 Diagram 4-21-14
516th VTC Bldg. 520 Diagram 4-21-14516th VTC Bldg. 520 Diagram 4-21-14
516th VTC Bldg. 520 Diagram 4-21-14
 
Edu ciaa-nxp pinout-a4_v4r3_es
Edu ciaa-nxp pinout-a4_v4r3_esEdu ciaa-nxp pinout-a4_v4r3_es
Edu ciaa-nxp pinout-a4_v4r3_es
 
Robotics lec7
Robotics lec7Robotics lec7
Robotics lec7
 
How to configure EIGRP on a Cisco router
How to configure EIGRP on a Cisco routerHow to configure EIGRP on a Cisco router
How to configure EIGRP on a Cisco router
 
REPORT
REPORTREPORT
REPORT
 
Manual usuario - Inspur cx-h81-m1 v2 0
Manual usuario  - Inspur cx-h81-m1 v2 0Manual usuario  - Inspur cx-h81-m1 v2 0
Manual usuario - Inspur cx-h81-m1 v2 0
 
74ALVT162245DGG:11- Componentschip.com
74ALVT162245DGG:11- Componentschip.com74ALVT162245DGG:11- Componentschip.com
74ALVT162245DGG:11- Componentschip.com
 
ARM Polyglot Shellcode - HITB2019AMS
ARM Polyglot Shellcode - HITB2019AMSARM Polyglot Shellcode - HITB2019AMS
ARM Polyglot Shellcode - HITB2019AMS
 
Uart VHDL RTL design tutorial
Uart VHDL RTL design tutorialUart VHDL RTL design tutorial
Uart VHDL RTL design tutorial
 
Senior Design - Remote Handler Device&quot;
Senior Design - Remote Handler Device&quot;Senior Design - Remote Handler Device&quot;
Senior Design - Remote Handler Device&quot;
 
ハイパフォーマンスブラウザネットワーキング2
ハイパフォーマンスブラウザネットワーキング2ハイパフォーマンスブラウザネットワーキング2
ハイパフォーマンスブラウザネットワーキング2
 
FINISHED_CODE
FINISHED_CODEFINISHED_CODE
FINISHED_CODE
 
0.47 inch LCD Micro Dispalay 800x600 Resolution RGB Interface LCD Screen
0.47 inch LCD Micro Dispalay 800x600 Resolution RGB Interface LCD Screen0.47 inch LCD Micro Dispalay 800x600 Resolution RGB Interface LCD Screen
0.47 inch LCD Micro Dispalay 800x600 Resolution RGB Interface LCD Screen
 
An introduction to Hubot - CloudConf 2015 - Turin Italy
An introduction to Hubot - CloudConf 2015 - Turin ItalyAn introduction to Hubot - CloudConf 2015 - Turin Italy
An introduction to Hubot - CloudConf 2015 - Turin Italy
 
New microsoft office power point presentation
New microsoft office power point presentationNew microsoft office power point presentation
New microsoft office power point presentation
 
LG Cable
LG CableLG Cable
LG Cable
 
ADS-B, AIS, APRS cheatsheet
ADS-B, AIS, APRS cheatsheetADS-B, AIS, APRS cheatsheet
ADS-B, AIS, APRS cheatsheet
 
abc song
abc songabc song
abc song
 
Hexapod ppt
Hexapod pptHexapod ppt
Hexapod ppt
 
AWS ロボを作ろう JAWSUG Kobe
AWS ロボを作ろう JAWSUG KobeAWS ロボを作ろう JAWSUG Kobe
AWS ロボを作ろう JAWSUG Kobe
 

Similar to code for DTMF and bluetooth based digital switch board

Atmega lcd programing_with_header_file
Atmega lcd programing_with_header_fileAtmega lcd programing_with_header_file
Atmega lcd programing_with_header_fileABHISHEK MAURYA
 
codings related to avr micro controller
codings related to avr micro controllercodings related to avr micro controller
codings related to avr micro controllerSyed Ghufran Hassan
 
#include LPC17xx.h#include Lights.h#include traffic_fo.docx
#include LPC17xx.h#include Lights.h#include traffic_fo.docx#include LPC17xx.h#include Lights.h#include traffic_fo.docx
#include LPC17xx.h#include Lights.h#include traffic_fo.docxajoy21
 
Dam gate open close lpc prog
Dam gate open close lpc progDam gate open close lpc prog
Dam gate open close lpc prognikhil dixit
 
PBL1-v1-002j.pptx
PBL1-v1-002j.pptxPBL1-v1-002j.pptx
PBL1-v1-002j.pptxNAIST
 
Embedded Systems Project 3rd Year
Embedded Systems Project 3rd YearEmbedded Systems Project 3rd Year
Embedded Systems Project 3rd YearAndrew Kozik
 
Microcontroladores: programas de CCS Compiler.docx
Microcontroladores: programas de CCS Compiler.docxMicrocontroladores: programas de CCS Compiler.docx
Microcontroladores: programas de CCS Compiler.docxSANTIAGO PABLO ALBERTO
 
Embedded JavaScript
Embedded JavaScriptEmbedded JavaScript
Embedded JavaScriptJens Siebert
 
Design and build a wireless transceiver using nrf24l01p single chip 2.4g hz
Design and build a wireless transceiver using nrf24l01p single chip 2.4g hz Design and build a wireless transceiver using nrf24l01p single chip 2.4g hz
Design and build a wireless transceiver using nrf24l01p single chip 2.4g hz Ehsan Izadi
 
PIC16F877A C Programming.ppt
PIC16F877A C Programming.pptPIC16F877A C Programming.ppt
PIC16F877A C Programming.pptIlaiyarajaS1
 
ISCA Final Presentaiton - Compilations
ISCA Final Presentaiton -  CompilationsISCA Final Presentaiton -  Compilations
ISCA Final Presentaiton - CompilationsHSA Foundation
 
Functions for Nano 5 Card
Functions for Nano 5 CardFunctions for Nano 5 Card
Functions for Nano 5 CardOmar Sanchez
 
Codigo fuente
Codigo fuenteCodigo fuente
Codigo fuenteBlackD10
 
Ospf Last Modified Eng
Ospf  Last Modified EngOspf  Last Modified Eng
Ospf Last Modified EngAlp isik
 
Kernel Recipes 2017 - Performance analysis Superpowers with Linux BPF - Brend...
Kernel Recipes 2017 - Performance analysis Superpowers with Linux BPF - Brend...Kernel Recipes 2017 - Performance analysis Superpowers with Linux BPF - Brend...
Kernel Recipes 2017 - Performance analysis Superpowers with Linux BPF - Brend...Anne Nicolas
 
Kernel Recipes 2017: Performance Analysis with BPF
Kernel Recipes 2017: Performance Analysis with BPFKernel Recipes 2017: Performance Analysis with BPF
Kernel Recipes 2017: Performance Analysis with BPFBrendan Gregg
 

Similar to code for DTMF and bluetooth based digital switch board (20)

Atmega lcd programing_with_header_file
Atmega lcd programing_with_header_fileAtmega lcd programing_with_header_file
Atmega lcd programing_with_header_file
 
codings related to avr micro controller
codings related to avr micro controllercodings related to avr micro controller
codings related to avr micro controller
 
PIC and LCD
PIC and LCDPIC and LCD
PIC and LCD
 
#include LPC17xx.h#include Lights.h#include traffic_fo.docx
#include LPC17xx.h#include Lights.h#include traffic_fo.docx#include LPC17xx.h#include Lights.h#include traffic_fo.docx
#include LPC17xx.h#include Lights.h#include traffic_fo.docx
 
Dam gate open close lpc prog
Dam gate open close lpc progDam gate open close lpc prog
Dam gate open close lpc prog
 
Lcd n PIC16F
Lcd n PIC16FLcd n PIC16F
Lcd n PIC16F
 
PBL1-v1-002j.pptx
PBL1-v1-002j.pptxPBL1-v1-002j.pptx
PBL1-v1-002j.pptx
 
Embedded Systems Project 3rd Year
Embedded Systems Project 3rd YearEmbedded Systems Project 3rd Year
Embedded Systems Project 3rd Year
 
Microcontroladores: programas de CCS Compiler.docx
Microcontroladores: programas de CCS Compiler.docxMicrocontroladores: programas de CCS Compiler.docx
Microcontroladores: programas de CCS Compiler.docx
 
Embedded JavaScript
Embedded JavaScriptEmbedded JavaScript
Embedded JavaScript
 
Design and build a wireless transceiver using nrf24l01p single chip 2.4g hz
Design and build a wireless transceiver using nrf24l01p single chip 2.4g hz Design and build a wireless transceiver using nrf24l01p single chip 2.4g hz
Design and build a wireless transceiver using nrf24l01p single chip 2.4g hz
 
Experiment 16 x2 parallel lcd
Experiment   16 x2 parallel lcdExperiment   16 x2 parallel lcd
Experiment 16 x2 parallel lcd
 
LCD_Example.pptx
LCD_Example.pptxLCD_Example.pptx
LCD_Example.pptx
 
PIC16F877A C Programming.ppt
PIC16F877A C Programming.pptPIC16F877A C Programming.ppt
PIC16F877A C Programming.ppt
 
ISCA Final Presentaiton - Compilations
ISCA Final Presentaiton -  CompilationsISCA Final Presentaiton -  Compilations
ISCA Final Presentaiton - Compilations
 
Functions for Nano 5 Card
Functions for Nano 5 CardFunctions for Nano 5 Card
Functions for Nano 5 Card
 
Codigo fuente
Codigo fuenteCodigo fuente
Codigo fuente
 
Ospf Last Modified Eng
Ospf  Last Modified EngOspf  Last Modified Eng
Ospf Last Modified Eng
 
Kernel Recipes 2017 - Performance analysis Superpowers with Linux BPF - Brend...
Kernel Recipes 2017 - Performance analysis Superpowers with Linux BPF - Brend...Kernel Recipes 2017 - Performance analysis Superpowers with Linux BPF - Brend...
Kernel Recipes 2017 - Performance analysis Superpowers with Linux BPF - Brend...
 
Kernel Recipes 2017: Performance Analysis with BPF
Kernel Recipes 2017: Performance Analysis with BPFKernel Recipes 2017: Performance Analysis with BPF
Kernel Recipes 2017: Performance Analysis with BPF
 

Recently uploaded

Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 

Recently uploaded (20)

Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 

code for DTMF and bluetooth based digital switch board

  • 1. APPENDIX 1 /* * bluetooth/Lcd/rkg.c * Created: 4/6/2015 4:30:08 PM * Author: Shashi Verma */ #include<avr/io.h> #include<util/delay.h> #define lcd PORTB #define rs PB0 #define rw PB1 #define en PB2 void lcd_cmd(unsigned char com); void lcd_data(unsigned char data); void lcd_string(unsigned char *str); //------------------------------------------------------------------------ void USARTInit(uint16_t ubrr_value) { UBRRL = ubrr_value; UBRRH = (ubrr_value>>8); UCSRC|=(1<<URSEL)|(1<<UCSZ1)|(1<<UCSZ0); UCSRB|=(1<<RXEN)|(1<<TXEN)|(1<<RXCIE); } unsigned char USARTReadChar() { while(!(UCSRA & (1<<RXC))); return UDR;
  • 2. } void USARTWriteChar(char data) { while(!(UCSRA & (1<<UDRE))); UDR=data; } void USART_StringTransmit(unsigned char s[]) { int i=0; while(s[i]!='0') { USARTWriteChar(s[i]); i++; } } void main() { int x; DDRB=0xFF; DDRC=0xFF; char Recieved_command; _delay_ms(50); USARTInit(51); lcd_cmd(0x02);//home location lcd_cmd(0x28);//2x16 lcd 4bit mode lcd_cmd(0x0C);//dispy on cursor blink lcd_cmd(0x06);//increament
  • 3. while(1) { Recieved_command=USARTReadChar(); if(Recieved_command=='1') { USART_StringTransmit("n Light On 1 "); PORTC=0b00000001; lcd_cmd(0xc0); lcd_string(" Light On 1 "); } else if(Recieved_command=='2') { USART_StringTransmit("n Light On 2 "); PORTC=0b00000010; lcd_cmd(0xc0); lcd_string(" Light On 2 "); } else if(Recieved_command=='3') { USART_StringTransmit("n Fan On "); PORTC=0b00000100; lcd_cmd(0xc0); lcd_string(" Fan On "); } else if(Recieved_command=='4') { USART_StringTransmit("n Both Light On");
  • 4. PORTC=0b00000011; lcd_cmd(0xc0); lcd_string(" Both Light On "); } else if(Recieved_command=='5') { USART_StringTransmit("n Light 1 & Fan On"); PORTC=0b00000101; lcd_cmd(0xc0); lcd_string("Light 1 & Fan On "); } if(Recieved_command=='6') { USART_StringTransmit("n Light 2 & Fan On "); PORTC=0b00000110; lcd_cmd(0xc0); lcd_string("Light 2 & Fan On "); } else if(Recieved_command=='7') { USART_StringTransmit("n All Device On!!"); PORTC=0b00000111; lcd_cmd(0xc0); lcd_string(" All Device On !! } else if(Recieved_command=='8') {
  • 5. USART_StringTransmit("n Shut Down !! "); PORTC=0b00000000; lcd_cmd(0xc0); lcd_string(" Shut Down !! ") } } } void lcd_cmd(unsigned char com) { //for command rs=0,rw=0,en=1,en=0 char cmd1; cmd1=(com&(0xF0));//upper 4 bit data lcd=cmd1; lcd&=~(1<<rs);//rs=0 lcd&=~(1<<rw);//rw=0 lcd|=(1<<en);//en=1 _delay_ms(5); lcd&=~(1<<en); cmd1=((com<<4)&(0xF0));// Lower 4 bit data lcd=cmd1; lcd&=~(1<<rs);//rs=0 lcd&=~(1<<rw);//rw=0 lcd|=(1<<en);//en=1 _delay_ms(5); lcd&=~(1<<en); } void lcd_data(unsigned char data) {
  • 6. unsigned char data1; data1=(data&(0xF0));// upper 4 bit lcd=data1; lcd|=(1<<rs); //rs=1 lcd&=~(1<<rw);//rw=0 lcd|=(1<<en);//en=1 _delay_ms(1); lcd&=~(1<<en);//en=0 data1=((data<<4)&(0xF0));//lower 4 bit data lcd=data1; lcd|=(1<<rs);//rs=1 lcd&=~(1<<rw);//rw=0 lcd|=(1<<en);//en=1 _delay_ms(1); lcd&=~(1<<en); } //-------------------------------------------------------------- void lcd_string(unsigned char *str) { int i=0; while(str[i]!='0') { lcd_data(str[i]); i++; } }
  • 7. APPENDIX /* * home_automatio_RKGEC.c * Created: 3/21/2015 7:49:00 AM * Author: Shashi */ #include <avr/io.h> #include<util/delay.h> int main(void) { // DDRA=0XFF DDRB=0x00; DDRC=0xFF; while(1) { if(PINB==0b00000001) { PORTC=0b00000001; } if(PINB==0b00000010) { PORTC=0b00000010; } if(PINB==0b00000011) { PORTC=0b00000100; } if(PINB==0b00000100)