SlideShare a Scribd company logo
Interface 7 Segment with MC. Display the number from 0-9 on 7 Segment
CODING
#define LED PORTC
int j=0;
int i=0;
void main()
{
unsigned char LD[10]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f};
TRISC=0;
LED=0;
while(1)
{
for(i=0;i<10;i++)
{
LED=LD[i];
delay_ms(200);
}
}
}
input byte of data in MC at Rb0 serially one bit at a time. LSB should come first
CODING
#define pb0 portb.f0
void main()
{
unsigned char x;
unsigned char assign=0;
trisb.f0=1;
trisd=0;
for(x=0;x<8;x++)
{
assign=assign>>1;
assign=(pb0 & 0x01)<<7;
}
portd=assign;
}
Input byte of data in MC at Rb0 serially one bit at a time. MSB should come first
CODING
#define pb0 portb.f0
void main()
{
unsigned char x;
unsigned char assign=0;
trisb.f0=1;
trisd=0;
for(x=0;x<8;x++)
{
assign=assign<<1;
assign=pb0 & 0x01;
}
portd=assign;
}
Controlling direction of Stepper Motor
CODING
void step(unsigned char);
void main()
{
unsigned char i;
trisd=0;
for(i=1;i<=40;i++)
{
step(0x03);
delay_ms(1000);
step(0x06);
delay_ms(1000);
step(0x0c);
delay_ms(1000);
step(0x09);
delay_ms(1000);
}
}
void step(unsigned char st)
{
portd=st;
}
ON OFF AC BULB 220V USING RELAY N MC
HARDWARE
CODING
void main()
{
TRISD.F0=0;
TRISB.F0=1;
portd.f0=0;
while(1)
{
if(PORTB.F0==1)
{
portd.f0=1;
delay_ms(200);
}
portd.f0=0;
}
}
Design Temperature control system for furnace, Two temperature switches are installed
in furnace to sense hotness and coldness. Specification for hot sensors is Temperature
greater than 100 degree, For Cold sensors is temperature less than 35 degree. If Furnace is
Hot Make flame off, If furnace is Cold make flame on
CODING
void main(void)
{
TRISC=0;
INTCON.GIE=1;
INTCON.INT0IF=0;
INTCON.INT0IE=1;
INTCON3.INT1IF=0;
INTCON3.INT1IE=1;
INTCON2.INTEDG0=1;
INTCON2.INTEDG1=1;
while(1)
{ }
}
void interrupt (void)
{
Lcd_Init(&PORTC); // Initialize LCD connected to PORTC
Lcd_Cmd(Lcd_CLEAR); // Clear display
Lcd_Cmd(Lcd_CURSOR_OFF); // Turn cursor off
if(INTCON.INT0IF)
{
Lcd_Out(1, 1, "FURNANCE OFF");
INTCON.INT0IF=0;
}
if(INTCON3.INT1IF)
{
Lcd_Out(1, 1, "FURNANCE ON");
INTCON3.INT1IF=0;
}}
Design the interface of stepper motor with MC, Degree of circular motion of stepper
motor is entered from keypad and display degree & Motion on LCD
unsigned char kp = ' ';
char keypadPort at PORTB;
void step(unsigned char);
void step(unsigned char st)
{
portc=st;
}
void main(){
unsigned int temp;
unsigned int key;
unsigned char i,n;
TRISD=0;
Keypad_Init();
Lcd_Init();
Lcd_Config(&PORTD,3,1,2,0,7,6,5,4);
Lcd_Cmd(_LCD_CLEAR);
Lcd_Cmd(_LCD_CURSOR_OFF);
Lcd_Out(1, 1, "LCD ON ");
Delay_ms(500);
do {
temp = Keypad_key_click();
delay_ms(500);
Lcd_Cmd(_LCD_CLEAR);
switch (temp) {
case 5: Lcd_Cmd(_LCD_CLEAR); key=9; Lcd_Out(1, 1, "9"); break;
case 6: Lcd_Cmd(_LCD_CLEAR); key=6; Lcd_Out(1, 1, "6"); break;
case 7: Lcd_Cmd(_LCD_CLEAR); key=3; Lcd_Out(1, 1, "3"); break;
case 9: Lcd_Cmd(_LCD_CLEAR); key=8; Lcd_Out(1, 1, "8"); break;
case 10: Lcd_Cmd(_LCD_CLEAR); key=5; Lcd_Out(1, 1, "5"); break;
case 11: Lcd_Cmd(_LCD_CLEAR); key=2; Lcd_Out(1, 1, "2"); break;
case 12: Lcd_Cmd(_LCD_CLEAR); key=0; Lcd_Out(1, 1, "0"); break;
case 13: Lcd_Cmd(_LCD_CLEAR); key=7; Lcd_Out(1, 1, "7"); break;
case 14: Lcd_Cmd(_LCD_CLEAR); key=4; Lcd_Out(1, 1, "4"); break;
case 15: Lcd_Cmd(_LCD_CLEAR); key=1; Lcd_Out(1, 1, "1"); break;
case 16: Lcd_Cmd(_LCD_CLEAR); break;
}
trisd=0;
n=30/key;
for(i=1;i<=n;i++)
{
step(0x03);
delay_ms(300);
step(0x06);
delay_ms(300);
step(0x0c);
delay_ms(300);
step(0x09);
delay_ms(300);
}
} while (1);
}
case 13: Lcd_Cmd(_LCD_CLEAR); key=7; Lcd_Out(1, 1, "7"); break;
case 14: Lcd_Cmd(_LCD_CLEAR); key=4; Lcd_Out(1, 1, "4"); break;
case 15: Lcd_Cmd(_LCD_CLEAR); key=1; Lcd_Out(1, 1, "1"); break;
case 16: Lcd_Cmd(_LCD_CLEAR); break;
}
trisd=0;
n=30/key;
for(i=1;i<=n;i++)
{
step(0x03);
delay_ms(300);
step(0x06);
delay_ms(300);
step(0x0c);
delay_ms(300);
step(0x09);
delay_ms(300);
}
} while (1);
}

More Related Content

What's hot (20)

Two digit-countdown-timer
Two digit-countdown-timerTwo digit-countdown-timer
Two digit-countdown-timer
 
Seven Segment Displau
Seven Segment DisplauSeven Segment Displau
Seven Segment Displau
 
Micro Assignment 1
Micro Assignment 1Micro Assignment 1
Micro Assignment 1
 
LED Blinking logic on LPC1768
LED Blinking logic on LPC1768LED Blinking logic on LPC1768
LED Blinking logic on LPC1768
 
Assignment#4a
Assignment#4aAssignment#4a
Assignment#4a
 
Assignment#5
Assignment#5Assignment#5
Assignment#5
 
Lab programs FOR 8TH SEM EC SUBJECT BY LOHITH KUMAR |11GUEE6018
Lab programs FOR 8TH SEM EC SUBJECT BY LOHITH KUMAR |11GUEE6018Lab programs FOR 8TH SEM EC SUBJECT BY LOHITH KUMAR |11GUEE6018
Lab programs FOR 8TH SEM EC SUBJECT BY LOHITH KUMAR |11GUEE6018
 
Assignment#6
Assignment#6Assignment#6
Assignment#6
 
4x4
4x44x4
4x4
 
Assignment#4b
Assignment#4bAssignment#4b
Assignment#4b
 
Assignment#2
Assignment#2Assignment#2
Assignment#2
 
Compteur ARDUINO
Compteur ARDUINOCompteur ARDUINO
Compteur ARDUINO
 
Arduino based applications part 1
Arduino based applications part 1Arduino based applications part 1
Arduino based applications part 1
 
Pic programms FOR 8TH SEM STUDENTS BY LOHITH KUMAR | 11GUEE6018
Pic programms FOR 8TH SEM STUDENTS BY LOHITH KUMAR | 11GUEE6018Pic programms FOR 8TH SEM STUDENTS BY LOHITH KUMAR | 11GUEE6018
Pic programms FOR 8TH SEM STUDENTS BY LOHITH KUMAR | 11GUEE6018
 
Assignment#3a
Assignment#3aAssignment#3a
Assignment#3a
 
Assignment#7b
Assignment#7bAssignment#7b
Assignment#7b
 
Mci ppt
Mci pptMci ppt
Mci ppt
 
Solution doc
Solution docSolution doc
Solution doc
 
Day1
Day1Day1
Day1
 
Verilog VHDL code Decoder and Encoder
Verilog VHDL code Decoder and EncoderVerilog VHDL code Decoder and Encoder
Verilog VHDL code Decoder and Encoder
 

Similar to 22 microcontroller programs

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
 
Vechicle accident prevention using eye bilnk sensor ppt
Vechicle accident prevention using eye bilnk sensor pptVechicle accident prevention using eye bilnk sensor ppt
Vechicle accident prevention using eye bilnk sensor pptsatish 486
 
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
 
Combine the keypad and LCD codes in compliance to the following requ.pdf
Combine the keypad and LCD codes in compliance to the following requ.pdfCombine the keypad and LCD codes in compliance to the following requ.pdf
Combine the keypad and LCD codes in compliance to the following requ.pdfforwardcom41
 
m.tech esd lab manual for record
m.tech esd lab manual for recordm.tech esd lab manual for record
m.tech esd lab manual for recordG Lemuel George
 
Pythonによるカスタム可能な高位設計技術 (Design Solution Forum 2016@新横浜)
Pythonによるカスタム可能な高位設計技術 (Design Solution Forum 2016@新横浜)Pythonによるカスタム可能な高位設計技術 (Design Solution Forum 2016@新横浜)
Pythonによるカスタム可能な高位設計技術 (Design Solution Forum 2016@新横浜)Shinya Takamaeda-Y
 
2022-BEKM 3453 - LCD and keypad.pdf
2022-BEKM 3453 - LCD and keypad.pdf2022-BEKM 3453 - LCD and keypad.pdf
2022-BEKM 3453 - LCD and keypad.pdfVNEX
 
Embedded systems design @ defcon 2015
Embedded systems design @ defcon 2015Embedded systems design @ defcon 2015
Embedded systems design @ defcon 2015Rodrigo Almeida
 
Dam gate open close lpc prog
Dam gate open close lpc progDam gate open close lpc prog
Dam gate open close lpc prognikhil dixit
 
Automatic room light controller with visible counter
Automatic room light controller with visible counterAutomatic room light controller with visible counter
Automatic room light controller with visible counterMafaz Ahmed
 
第二回 冬のスイッチ大勉強会 - FullColorLED & MPU-6050編 -
第二回 冬のスイッチ大勉強会 - FullColorLED & MPU-6050編 -第二回 冬のスイッチ大勉強会 - FullColorLED & MPU-6050編 -
第二回 冬のスイッチ大勉強会 - FullColorLED & MPU-6050編 -Wataru Kani
 

Similar to 22 microcontroller programs (20)

Microcontroladores: programas de CCS Compiler.docx
Microcontroladores: programas de CCS Compiler.docxMicrocontroladores: programas de CCS Compiler.docx
Microcontroladores: programas de CCS Compiler.docx
 
131080111003 mci
131080111003 mci131080111003 mci
131080111003 mci
 
Vechicle accident prevention using eye bilnk sensor ppt
Vechicle accident prevention using eye bilnk sensor pptVechicle accident prevention using eye bilnk sensor ppt
Vechicle accident prevention using eye bilnk sensor ppt
 
Basic standard calculator
Basic standard calculatorBasic standard calculator
Basic standard calculator
 
REPORT
REPORTREPORT
REPORT
 
codings related to avr micro controller
codings related to avr micro controllercodings related to avr micro controller
codings related to avr micro controller
 
ESD -DAY 24.pptx
ESD -DAY 24.pptxESD -DAY 24.pptx
ESD -DAY 24.pptx
 
PIC and LCD
PIC and LCDPIC and LCD
PIC and LCD
 
Direct analog
Direct analogDirect analog
Direct analog
 
Uart
UartUart
Uart
 
Combine the keypad and LCD codes in compliance to the following requ.pdf
Combine the keypad and LCD codes in compliance to the following requ.pdfCombine the keypad and LCD codes in compliance to the following requ.pdf
Combine the keypad and LCD codes in compliance to the following requ.pdf
 
m.tech esd lab manual for record
m.tech esd lab manual for recordm.tech esd lab manual for record
m.tech esd lab manual for record
 
Pythonによるカスタム可能な高位設計技術 (Design Solution Forum 2016@新横浜)
Pythonによるカスタム可能な高位設計技術 (Design Solution Forum 2016@新横浜)Pythonによるカスタム可能な高位設計技術 (Design Solution Forum 2016@新横浜)
Pythonによるカスタム可能な高位設計技術 (Design Solution Forum 2016@新横浜)
 
LCD_Example.pptx
LCD_Example.pptxLCD_Example.pptx
LCD_Example.pptx
 
2022-BEKM 3453 - LCD and keypad.pdf
2022-BEKM 3453 - LCD and keypad.pdf2022-BEKM 3453 - LCD and keypad.pdf
2022-BEKM 3453 - LCD and keypad.pdf
 
Embedded systems design @ defcon 2015
Embedded systems design @ defcon 2015Embedded systems design @ defcon 2015
Embedded systems design @ defcon 2015
 
An Example MIPS
An Example  MIPSAn Example  MIPS
An Example MIPS
 
Dam gate open close lpc prog
Dam gate open close lpc progDam gate open close lpc prog
Dam gate open close lpc prog
 
Automatic room light controller with visible counter
Automatic room light controller with visible counterAutomatic room light controller with visible counter
Automatic room light controller with visible counter
 
第二回 冬のスイッチ大勉強会 - FullColorLED & MPU-6050編 -
第二回 冬のスイッチ大勉強会 - FullColorLED & MPU-6050編 -第二回 冬のスイッチ大勉強会 - FullColorLED & MPU-6050編 -
第二回 冬のスイッチ大勉強会 - FullColorLED & MPU-6050編 -
 

More from babak danyal

Easy Steps to implement UDP Server and Client Sockets
Easy Steps to implement UDP Server and Client SocketsEasy Steps to implement UDP Server and Client Sockets
Easy Steps to implement UDP Server and Client Socketsbabak danyal
 
Java IO Package and Streams
Java IO Package and StreamsJava IO Package and Streams
Java IO Package and Streamsbabak danyal
 
Swing and Graphical User Interface in Java
Swing and Graphical User Interface in JavaSwing and Graphical User Interface in Java
Swing and Graphical User Interface in Javababak danyal
 
block ciphers and the des
block ciphers and the desblock ciphers and the des
block ciphers and the desbabak danyal
 
key distribution in network security
key distribution in network securitykey distribution in network security
key distribution in network securitybabak danyal
 
Lecture10 Signal and Systems
Lecture10 Signal and SystemsLecture10 Signal and Systems
Lecture10 Signal and Systemsbabak danyal
 
Lecture8 Signal and Systems
Lecture8 Signal and SystemsLecture8 Signal and Systems
Lecture8 Signal and Systemsbabak danyal
 
Lecture7 Signal and Systems
Lecture7 Signal and SystemsLecture7 Signal and Systems
Lecture7 Signal and Systemsbabak danyal
 
Lecture6 Signal and Systems
Lecture6 Signal and SystemsLecture6 Signal and Systems
Lecture6 Signal and Systemsbabak danyal
 
Lecture5 Signal and Systems
Lecture5 Signal and SystemsLecture5 Signal and Systems
Lecture5 Signal and Systemsbabak danyal
 
Lecture4 Signal and Systems
Lecture4  Signal and SystemsLecture4  Signal and Systems
Lecture4 Signal and Systemsbabak danyal
 
Lecture3 Signal and Systems
Lecture3 Signal and SystemsLecture3 Signal and Systems
Lecture3 Signal and Systemsbabak danyal
 
Lecture2 Signal and Systems
Lecture2 Signal and SystemsLecture2 Signal and Systems
Lecture2 Signal and Systemsbabak danyal
 
Lecture1 Intro To Signa
Lecture1 Intro To SignaLecture1 Intro To Signa
Lecture1 Intro To Signababak danyal
 
Lecture9 Signal and Systems
Lecture9 Signal and SystemsLecture9 Signal and Systems
Lecture9 Signal and Systemsbabak danyal
 
Cns 13f-lec03- Classical Encryption Techniques
Cns 13f-lec03- Classical Encryption TechniquesCns 13f-lec03- Classical Encryption Techniques
Cns 13f-lec03- Classical Encryption Techniquesbabak danyal
 
Classical Encryption Techniques in Network Security
Classical Encryption Techniques in Network SecurityClassical Encryption Techniques in Network Security
Classical Encryption Techniques in Network Securitybabak danyal
 

More from babak danyal (20)

applist
applistapplist
applist
 
Easy Steps to implement UDP Server and Client Sockets
Easy Steps to implement UDP Server and Client SocketsEasy Steps to implement UDP Server and Client Sockets
Easy Steps to implement UDP Server and Client Sockets
 
Java IO Package and Streams
Java IO Package and StreamsJava IO Package and Streams
Java IO Package and Streams
 
Swing and Graphical User Interface in Java
Swing and Graphical User Interface in JavaSwing and Graphical User Interface in Java
Swing and Graphical User Interface in Java
 
Tcp sockets
Tcp socketsTcp sockets
Tcp sockets
 
block ciphers and the des
block ciphers and the desblock ciphers and the des
block ciphers and the des
 
key distribution in network security
key distribution in network securitykey distribution in network security
key distribution in network security
 
Lecture10 Signal and Systems
Lecture10 Signal and SystemsLecture10 Signal and Systems
Lecture10 Signal and Systems
 
Lecture8 Signal and Systems
Lecture8 Signal and SystemsLecture8 Signal and Systems
Lecture8 Signal and Systems
 
Lecture7 Signal and Systems
Lecture7 Signal and SystemsLecture7 Signal and Systems
Lecture7 Signal and Systems
 
Lecture6 Signal and Systems
Lecture6 Signal and SystemsLecture6 Signal and Systems
Lecture6 Signal and Systems
 
Lecture5 Signal and Systems
Lecture5 Signal and SystemsLecture5 Signal and Systems
Lecture5 Signal and Systems
 
Lecture4 Signal and Systems
Lecture4  Signal and SystemsLecture4  Signal and Systems
Lecture4 Signal and Systems
 
Lecture3 Signal and Systems
Lecture3 Signal and SystemsLecture3 Signal and Systems
Lecture3 Signal and Systems
 
Lecture2 Signal and Systems
Lecture2 Signal and SystemsLecture2 Signal and Systems
Lecture2 Signal and Systems
 
Lecture1 Intro To Signa
Lecture1 Intro To SignaLecture1 Intro To Signa
Lecture1 Intro To Signa
 
Lecture9 Signal and Systems
Lecture9 Signal and SystemsLecture9 Signal and Systems
Lecture9 Signal and Systems
 
Lecture9
Lecture9Lecture9
Lecture9
 
Cns 13f-lec03- Classical Encryption Techniques
Cns 13f-lec03- Classical Encryption TechniquesCns 13f-lec03- Classical Encryption Techniques
Cns 13f-lec03- Classical Encryption Techniques
 
Classical Encryption Techniques in Network Security
Classical Encryption Techniques in Network SecurityClassical Encryption Techniques in Network Security
Classical Encryption Techniques in Network Security
 

Recently uploaded

GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...Nguyen Thanh Tu Collection
 
Solid waste management & Types of Basic civil Engineering notes by DJ Sir.pptx
Solid waste management & Types of Basic civil Engineering notes by DJ Sir.pptxSolid waste management & Types of Basic civil Engineering notes by DJ Sir.pptx
Solid waste management & Types of Basic civil Engineering notes by DJ Sir.pptxDenish Jangid
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleCeline George
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonSteve Thomason
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfTamralipta Mahavidyalaya
 
Forest and Wildlife Resources Class 10 Free Study Material PDF
Forest and Wildlife Resources Class 10 Free Study Material PDFForest and Wildlife Resources Class 10 Free Study Material PDF
Forest and Wildlife Resources Class 10 Free Study Material PDFVivekanand Anglo Vedic Academy
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345beazzy04
 
UNIT – IV_PCI Complaints: Complaints and evaluation of complaints, Handling o...
UNIT – IV_PCI Complaints: Complaints and evaluation of complaints, Handling o...UNIT – IV_PCI Complaints: Complaints and evaluation of complaints, Handling o...
UNIT – IV_PCI Complaints: Complaints and evaluation of complaints, Handling o...Sayali Powar
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxJheel Barad
 
Salient features of Environment protection Act 1986.pptx
Salient features of Environment protection Act 1986.pptxSalient features of Environment protection Act 1986.pptx
Salient features of Environment protection Act 1986.pptxakshayaramakrishnan21
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfjoachimlavalley1
 
Basic_QTL_Marker-assisted_Selection_Sourabh.ppt
Basic_QTL_Marker-assisted_Selection_Sourabh.pptBasic_QTL_Marker-assisted_Selection_Sourabh.ppt
Basic_QTL_Marker-assisted_Selection_Sourabh.pptSourabh Kumar
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPCeline George
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxPavel ( NSTU)
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxRaedMohamed3
 
Jose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptx
Jose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptxJose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptx
Jose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptxricssacare
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxEduSkills OECD
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfPo-Chuan Chen
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaasiemaillard
 

Recently uploaded (20)

GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
 
Solid waste management & Types of Basic civil Engineering notes by DJ Sir.pptx
Solid waste management & Types of Basic civil Engineering notes by DJ Sir.pptxSolid waste management & Types of Basic civil Engineering notes by DJ Sir.pptx
Solid waste management & Types of Basic civil Engineering notes by DJ Sir.pptx
 
Operations Management - Book1.p - Dr. Abdulfatah A. Salem
Operations Management - Book1.p  - Dr. Abdulfatah A. SalemOperations Management - Book1.p  - Dr. Abdulfatah A. Salem
Operations Management - Book1.p - Dr. Abdulfatah A. Salem
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
Forest and Wildlife Resources Class 10 Free Study Material PDF
Forest and Wildlife Resources Class 10 Free Study Material PDFForest and Wildlife Resources Class 10 Free Study Material PDF
Forest and Wildlife Resources Class 10 Free Study Material PDF
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
UNIT – IV_PCI Complaints: Complaints and evaluation of complaints, Handling o...
UNIT – IV_PCI Complaints: Complaints and evaluation of complaints, Handling o...UNIT – IV_PCI Complaints: Complaints and evaluation of complaints, Handling o...
UNIT – IV_PCI Complaints: Complaints and evaluation of complaints, Handling o...
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
Salient features of Environment protection Act 1986.pptx
Salient features of Environment protection Act 1986.pptxSalient features of Environment protection Act 1986.pptx
Salient features of Environment protection Act 1986.pptx
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
Basic_QTL_Marker-assisted_Selection_Sourabh.ppt
Basic_QTL_Marker-assisted_Selection_Sourabh.pptBasic_QTL_Marker-assisted_Selection_Sourabh.ppt
Basic_QTL_Marker-assisted_Selection_Sourabh.ppt
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERP
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
Jose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptx
Jose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptxJose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptx
Jose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptx
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 

22 microcontroller programs

  • 1. Interface 7 Segment with MC. Display the number from 0-9 on 7 Segment CODING #define LED PORTC int j=0; int i=0; void main() { unsigned char LD[10]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f}; TRISC=0; LED=0; while(1) { for(i=0;i<10;i++) { LED=LD[i]; delay_ms(200); } } } input byte of data in MC at Rb0 serially one bit at a time. LSB should come first CODING #define pb0 portb.f0 void main() { unsigned char x; unsigned char assign=0; trisb.f0=1; trisd=0; for(x=0;x<8;x++) { assign=assign>>1; assign=(pb0 & 0x01)<<7; } portd=assign; }
  • 2. Input byte of data in MC at Rb0 serially one bit at a time. MSB should come first CODING #define pb0 portb.f0 void main() { unsigned char x; unsigned char assign=0; trisb.f0=1; trisd=0; for(x=0;x<8;x++) { assign=assign<<1; assign=pb0 & 0x01; } portd=assign; } Controlling direction of Stepper Motor CODING void step(unsigned char); void main() { unsigned char i; trisd=0; for(i=1;i<=40;i++) { step(0x03); delay_ms(1000); step(0x06); delay_ms(1000); step(0x0c); delay_ms(1000); step(0x09); delay_ms(1000); } } void step(unsigned char st) { portd=st; } ON OFF AC BULB 220V USING RELAY N MC
  • 4. Design Temperature control system for furnace, Two temperature switches are installed in furnace to sense hotness and coldness. Specification for hot sensors is Temperature greater than 100 degree, For Cold sensors is temperature less than 35 degree. If Furnace is Hot Make flame off, If furnace is Cold make flame on CODING void main(void) { TRISC=0; INTCON.GIE=1; INTCON.INT0IF=0; INTCON.INT0IE=1; INTCON3.INT1IF=0; INTCON3.INT1IE=1; INTCON2.INTEDG0=1; INTCON2.INTEDG1=1; while(1) { } } void interrupt (void) { Lcd_Init(&PORTC); // Initialize LCD connected to PORTC Lcd_Cmd(Lcd_CLEAR); // Clear display Lcd_Cmd(Lcd_CURSOR_OFF); // Turn cursor off if(INTCON.INT0IF) { Lcd_Out(1, 1, "FURNANCE OFF"); INTCON.INT0IF=0; } if(INTCON3.INT1IF) { Lcd_Out(1, 1, "FURNANCE ON"); INTCON3.INT1IF=0; }}
  • 5. Design the interface of stepper motor with MC, Degree of circular motion of stepper motor is entered from keypad and display degree & Motion on LCD unsigned char kp = ' '; char keypadPort at PORTB; void step(unsigned char); void step(unsigned char st) { portc=st; } void main(){ unsigned int temp; unsigned int key; unsigned char i,n; TRISD=0; Keypad_Init(); Lcd_Init(); Lcd_Config(&PORTD,3,1,2,0,7,6,5,4); Lcd_Cmd(_LCD_CLEAR); Lcd_Cmd(_LCD_CURSOR_OFF); Lcd_Out(1, 1, "LCD ON "); Delay_ms(500); do { temp = Keypad_key_click(); delay_ms(500); Lcd_Cmd(_LCD_CLEAR); switch (temp) { case 5: Lcd_Cmd(_LCD_CLEAR); key=9; Lcd_Out(1, 1, "9"); break; case 6: Lcd_Cmd(_LCD_CLEAR); key=6; Lcd_Out(1, 1, "6"); break; case 7: Lcd_Cmd(_LCD_CLEAR); key=3; Lcd_Out(1, 1, "3"); break; case 9: Lcd_Cmd(_LCD_CLEAR); key=8; Lcd_Out(1, 1, "8"); break; case 10: Lcd_Cmd(_LCD_CLEAR); key=5; Lcd_Out(1, 1, "5"); break; case 11: Lcd_Cmd(_LCD_CLEAR); key=2; Lcd_Out(1, 1, "2"); break; case 12: Lcd_Cmd(_LCD_CLEAR); key=0; Lcd_Out(1, 1, "0"); break;
  • 6. case 13: Lcd_Cmd(_LCD_CLEAR); key=7; Lcd_Out(1, 1, "7"); break; case 14: Lcd_Cmd(_LCD_CLEAR); key=4; Lcd_Out(1, 1, "4"); break; case 15: Lcd_Cmd(_LCD_CLEAR); key=1; Lcd_Out(1, 1, "1"); break; case 16: Lcd_Cmd(_LCD_CLEAR); break; } trisd=0; n=30/key; for(i=1;i<=n;i++) { step(0x03); delay_ms(300); step(0x06); delay_ms(300); step(0x0c); delay_ms(300); step(0x09); delay_ms(300); } } while (1); }
  • 7. case 13: Lcd_Cmd(_LCD_CLEAR); key=7; Lcd_Out(1, 1, "7"); break; case 14: Lcd_Cmd(_LCD_CLEAR); key=4; Lcd_Out(1, 1, "4"); break; case 15: Lcd_Cmd(_LCD_CLEAR); key=1; Lcd_Out(1, 1, "1"); break; case 16: Lcd_Cmd(_LCD_CLEAR); break; } trisd=0; n=30/key; for(i=1;i<=n;i++) { step(0x03); delay_ms(300); step(0x06); delay_ms(300); step(0x0c); delay_ms(300); step(0x09); delay_ms(300); } } while (1); }