SlideShare a Scribd company logo
1 of 1
Download to read offline
write a C program for blinking light using function
** make sure it will compile
Solution
GPIO is General purpose input output it is very useful for blinking a led.
GPIO is configured with input and output. itis micro controller.
#include
/* PORT B0 is the microcontroller */
int main()
{
unsigned int signal =0;
/* Configure GPIO with input and output */
DDRB = 0x01;
while(1)
{
for (signal =0;signal <50000;signal ++)
{
PORTB = 0x00;
}
for (signal =0;signal <50000;signal ++)
{
PORTB = 0x01;
}
}
return 0;
}

More Related Content

More from info309708

How do you evaluate your own global mind set levelsSolutionAN.pdf
How do you evaluate your own global mind set levelsSolutionAN.pdfHow do you evaluate your own global mind set levelsSolutionAN.pdf
How do you evaluate your own global mind set levelsSolutionAN.pdf
info309708
 
Getting StartedCreate a class called Lab8. Use the same setup for .pdf
Getting StartedCreate a class called Lab8. Use the same setup for .pdfGetting StartedCreate a class called Lab8. Use the same setup for .pdf
Getting StartedCreate a class called Lab8. Use the same setup for .pdf
info309708
 
For this homework, you will develop a class called VendingMachine th.pdf
For this homework, you will develop a class called VendingMachine th.pdfFor this homework, you will develop a class called VendingMachine th.pdf
For this homework, you will develop a class called VendingMachine th.pdf
info309708
 
Describe the differences between the three major physical connection .pdf
Describe the differences between the three major physical connection .pdfDescribe the differences between the three major physical connection .pdf
Describe the differences between the three major physical connection .pdf
info309708
 
Create a student record management system using linked list and queu.pdf
Create a student record management system using linked list and queu.pdfCreate a student record management system using linked list and queu.pdf
Create a student record management system using linked list and queu.pdf
info309708
 
C programming. Answer question only in C code Ninth Deletion with B.pdf
C programming. Answer question only in C code Ninth Deletion with B.pdfC programming. Answer question only in C code Ninth Deletion with B.pdf
C programming. Answer question only in C code Ninth Deletion with B.pdf
info309708
 
Aside from the expansion of industrial capitalism, what factors affe.pdf
Aside from the expansion of industrial capitalism, what factors affe.pdfAside from the expansion of industrial capitalism, what factors affe.pdf
Aside from the expansion of industrial capitalism, what factors affe.pdf
info309708
 
Which of the following is not true about prokaryotes 1) They are th.pdf
Which of the following is not true about prokaryotes  1) They are th.pdfWhich of the following is not true about prokaryotes  1) They are th.pdf
Which of the following is not true about prokaryotes 1) They are th.pdf
info309708
 
what is the relationship between information hiding as an attribute .pdf
what is the relationship between information hiding as an attribute .pdfwhat is the relationship between information hiding as an attribute .pdf
what is the relationship between information hiding as an attribute .pdf
info309708
 
What are the biggest threats to a network in terms of security and w.pdf
What are the biggest threats to a network in terms of security and w.pdfWhat are the biggest threats to a network in terms of security and w.pdf
What are the biggest threats to a network in terms of security and w.pdf
info309708
 

More from info309708 (20)

How do you evaluate your own global mind set levelsSolutionAN.pdf
How do you evaluate your own global mind set levelsSolutionAN.pdfHow do you evaluate your own global mind set levelsSolutionAN.pdf
How do you evaluate your own global mind set levelsSolutionAN.pdf
 
Here are two datasetsDataset A 64 65 66 68 70 71 72Dataset B .pdf
Here are two datasetsDataset A 64 65 66 68 70 71 72Dataset B .pdfHere are two datasetsDataset A 64 65 66 68 70 71 72Dataset B .pdf
Here are two datasetsDataset A 64 65 66 68 70 71 72Dataset B .pdf
 
Getting StartedCreate a class called Lab8. Use the same setup for .pdf
Getting StartedCreate a class called Lab8. Use the same setup for .pdfGetting StartedCreate a class called Lab8. Use the same setup for .pdf
Getting StartedCreate a class called Lab8. Use the same setup for .pdf
 
For this homework, you will develop a class called VendingMachine th.pdf
For this homework, you will develop a class called VendingMachine th.pdfFor this homework, you will develop a class called VendingMachine th.pdf
For this homework, you will develop a class called VendingMachine th.pdf
 
Discuss what is SSH and the advantages and disadvantages of using it.pdf
Discuss what is SSH and the advantages and disadvantages of using it.pdfDiscuss what is SSH and the advantages and disadvantages of using it.pdf
Discuss what is SSH and the advantages and disadvantages of using it.pdf
 
Describe the differences between the three major physical connection .pdf
Describe the differences between the three major physical connection .pdfDescribe the differences between the three major physical connection .pdf
Describe the differences between the three major physical connection .pdf
 
Create a student record management system using linked list and queu.pdf
Create a student record management system using linked list and queu.pdfCreate a student record management system using linked list and queu.pdf
Create a student record management system using linked list and queu.pdf
 
Coca-Cola companyStrategic Goals and Objectivesi. Objectives are.pdf
Coca-Cola companyStrategic Goals and Objectivesi. Objectives are.pdfCoca-Cola companyStrategic Goals and Objectivesi. Objectives are.pdf
Coca-Cola companyStrategic Goals and Objectivesi. Objectives are.pdf
 
C programming. Answer question only in C code Ninth Deletion with B.pdf
C programming. Answer question only in C code Ninth Deletion with B.pdfC programming. Answer question only in C code Ninth Deletion with B.pdf
C programming. Answer question only in C code Ninth Deletion with B.pdf
 
Biology LabThe poisonous wastes of diptheria germs are called (A).pdf
Biology LabThe poisonous wastes of diptheria germs are called (A).pdfBiology LabThe poisonous wastes of diptheria germs are called (A).pdf
Biology LabThe poisonous wastes of diptheria germs are called (A).pdf
 
Aside from the expansion of industrial capitalism, what factors affe.pdf
Aside from the expansion of industrial capitalism, what factors affe.pdfAside from the expansion of industrial capitalism, what factors affe.pdf
Aside from the expansion of industrial capitalism, what factors affe.pdf
 
Yates (2009) notes that unions have a purpose broader than serving t.pdf
Yates (2009) notes that unions have a purpose broader than serving t.pdfYates (2009) notes that unions have a purpose broader than serving t.pdf
Yates (2009) notes that unions have a purpose broader than serving t.pdf
 
Which of the following is not true about prokaryotes 1) They are th.pdf
Which of the following is not true about prokaryotes  1) They are th.pdfWhich of the following is not true about prokaryotes  1) They are th.pdf
Which of the following is not true about prokaryotes 1) They are th.pdf
 
Which mitotic microtubules radiate outward from centrosome into the r.pdf
Which mitotic microtubules radiate outward from centrosome into the r.pdfWhich mitotic microtubules radiate outward from centrosome into the r.pdf
Which mitotic microtubules radiate outward from centrosome into the r.pdf
 
What type of motion best describes flexion of the trunk about the hi.pdf
What type of motion best describes flexion of the trunk about the hi.pdfWhat type of motion best describes flexion of the trunk about the hi.pdf
What type of motion best describes flexion of the trunk about the hi.pdf
 
what is the relationship between information hiding as an attribute .pdf
what is the relationship between information hiding as an attribute .pdfwhat is the relationship between information hiding as an attribute .pdf
what is the relationship between information hiding as an attribute .pdf
 
What is FERPA How does this impact youSolutionFERPA- FER.pdf
What is FERPA How does this impact youSolutionFERPA- FER.pdfWhat is FERPA How does this impact youSolutionFERPA- FER.pdf
What is FERPA How does this impact youSolutionFERPA- FER.pdf
 
What form of market efficiency do you think that the U. S. financial.pdf
What form of market efficiency do you think that the U. S. financial.pdfWhat form of market efficiency do you think that the U. S. financial.pdf
What form of market efficiency do you think that the U. S. financial.pdf
 
What are the biggest threats to a network in terms of security and w.pdf
What are the biggest threats to a network in terms of security and w.pdfWhat are the biggest threats to a network in terms of security and w.pdf
What are the biggest threats to a network in terms of security and w.pdf
 
This Question 1 pt One of the biggest factors in implementing SOX wa.pdf
This Question 1 pt One of the biggest factors in implementing SOX wa.pdfThis Question 1 pt One of the biggest factors in implementing SOX wa.pdf
This Question 1 pt One of the biggest factors in implementing SOX wa.pdf
 

Recently uploaded

Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
AnaAcapella
 
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lessonQUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
httgc7rh9c
 

Recently uploaded (20)

VAMOS CUIDAR DO NOSSO PLANETA! .
VAMOS CUIDAR DO NOSSO PLANETA!                    .VAMOS CUIDAR DO NOSSO PLANETA!                    .
VAMOS CUIDAR DO NOSSO PLANETA! .
 
How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & Systems
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
Economic Importance Of Fungi In Food Additives
Economic Importance Of Fungi In Food AdditivesEconomic Importance Of Fungi In Food Additives
Economic Importance Of Fungi In Food Additives
 
Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf arts
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Simple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdfSimple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdf
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lessonQUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
 

write a C program for blinking light using function make sure it.pdf

  • 1. write a C program for blinking light using function ** make sure it will compile Solution GPIO is General purpose input output it is very useful for blinking a led. GPIO is configured with input and output. itis micro controller. #include /* PORT B0 is the microcontroller */ int main() { unsigned int signal =0; /* Configure GPIO with input and output */ DDRB = 0x01; while(1) { for (signal =0;signal <50000;signal ++) { PORTB = 0x00; } for (signal =0;signal <50000;signal ++) { PORTB = 0x01; } } return 0; }