SlideShare a Scribd company logo
Programming in C.
Create a program which turns your Arduino into a light based electronic instrument. The
program should play music based on the amount of light hitting the optical sensor. There should
be a way to capture particularly pleasing tones and play those tones back in the order they are
captured.
The program must utilize the following :
• An array to hold the stored tones
• A function : void read_buttons( int *sw1, int *sw2, int *sw3, int *sw4) to read and store the
state of the four buttons on the board
• A function playback( notes[] ) which plays back the notes stored
• A function clear_playlist( *notes) which clears the stored tones
• A function tone_value() which generates a tone based on the current state of the optical sensor
• The possible tones should span the range of human hearing
Solution
#include
#include
using namespace std;
// Class Declaration
class prime
{
//Member Varibale Declaration
int a,k,i;
public:
prime(int x)
{
a=x;
}
// Object Creation For Class
void calculate()
{
k=1;
{
for(i=2;i<=a/2;i++)
if(a%i==0)
{
k=0;
break;
}
else
{
k=1;
}
}
}
void show()
{
if(k==1)
cout<<" "<>a;
// Object Creation For Class
prime obj(a);
// Call Member Functions
obj.calculate();
obj.show();
getch();
return 0;
}

More Related Content

Similar to Programming in C.Create a program which turns your Arduino into a .pdf

SDL2 Game Development VT Code Camp 2013
SDL2 Game Development VT Code Camp 2013SDL2 Game Development VT Code Camp 2013
SDL2 Game Development VT Code Camp 2013
Eric Basile
 
Ig2 task 1 work sheet s
Ig2 task 1 work sheet sIg2 task 1 work sheet s
Ig2 task 1 work sheet s
Shaz Riches
 
Ig2 task 1 work sheet s
Ig2 task 1 work sheet sIg2 task 1 work sheet s
Ig2 task 1 work sheet sShaz Riches
 
Modern Improvisation World
Modern Improvisation WorldModern Improvisation World
Modern Improvisation World
Willow Cheng
 
Chapt 1 (part 2) installing the sdk and exploring the workspace
Chapt 1 (part 2)   installing the sdk and exploring the workspaceChapt 1 (part 2)   installing the sdk and exploring the workspace
Chapt 1 (part 2) installing the sdk and exploring the workspaceMuhd Basheer
 
5707_10_auto-encoder.pptx
5707_10_auto-encoder.pptx5707_10_auto-encoder.pptx
5707_10_auto-encoder.pptx
SidoriOne
 
memory_allocation_use1.ppt
memory_allocation_use1.pptmemory_allocation_use1.ppt
memory_allocation_use1.ppt
KanchanTiwari45
 
Different types of Bits, bytes, and representation of information1.pdf
Different types of Bits, bytes, and representation of information1.pdfDifferent types of Bits, bytes, and representation of information1.pdf
Different types of Bits, bytes, and representation of information1.pdf
krram1989
 
The IoT Academy IoT training Arduino Part 5 Arduino peripherals
The IoT Academy IoT training Arduino Part 5 Arduino peripheralsThe IoT Academy IoT training Arduino Part 5 Arduino peripherals
The IoT Academy IoT training Arduino Part 5 Arduino peripherals
The IOT Academy
 
Digital signal processing through speech, hearing, and Python
Digital signal processing through speech, hearing, and PythonDigital signal processing through speech, hearing, and Python
Digital signal processing through speech, hearing, and Python
Mel Chua
 
Audio_Overview.pptx
Audio_Overview.pptxAudio_Overview.pptx
Audio_Overview.pptx
BinhHoang71
 
lect01.ppt
lect01.pptlect01.ppt
lect01.ppt
DrSamsonChepuri1
 
Livecoding with impromptu
Livecoding with impromptuLivecoding with impromptu
Livecoding with impromptuMichele Pasin
 
Michaelwilliamsig2task1worksheet
Michaelwilliamsig2task1worksheetMichaelwilliamsig2task1worksheet
Michaelwilliamsig2task1worksheetHooaax
 
Computer Programming and MCUs Assembly Language STM32Cu.pdf
Computer Programming and MCUs  Assembly Language  STM32Cu.pdfComputer Programming and MCUs  Assembly Language  STM32Cu.pdf
Computer Programming and MCUs Assembly Language STM32Cu.pdf
ableelectronics
 
Paper on Modeling and Subtractive synthesis of virtual violin
Paper on Modeling and Subtractive synthesis of virtual violinPaper on Modeling and Subtractive synthesis of virtual violin
Paper on Modeling and Subtractive synthesis of virtual violin
Vinoth Punniyamoorthy
 
Adam copeland ig2 task 1 work sheet
Adam copeland ig2 task 1 work sheetAdam copeland ig2 task 1 work sheet
Adam copeland ig2 task 1 work sheetcopelandadam
 
Adam copeland ig2 task 1 work sheet
Adam copeland ig2 task 1 work sheetAdam copeland ig2 task 1 work sheet
Adam copeland ig2 task 1 work sheetcopelandadam
 
Adam copeland ig2 task 1 work sheet
Adam copeland ig2 task 1 work sheetAdam copeland ig2 task 1 work sheet
Adam copeland ig2 task 1 work sheetcopelandadam
 

Similar to Programming in C.Create a program which turns your Arduino into a .pdf (20)

SDL2 Game Development VT Code Camp 2013
SDL2 Game Development VT Code Camp 2013SDL2 Game Development VT Code Camp 2013
SDL2 Game Development VT Code Camp 2013
 
Ig2 task 1 work sheet s
Ig2 task 1 work sheet sIg2 task 1 work sheet s
Ig2 task 1 work sheet s
 
Ig2 task 1 work sheet s
Ig2 task 1 work sheet sIg2 task 1 work sheet s
Ig2 task 1 work sheet s
 
Modern Improvisation World
Modern Improvisation WorldModern Improvisation World
Modern Improvisation World
 
Chapt 1 (part 2) installing the sdk and exploring the workspace
Chapt 1 (part 2)   installing the sdk and exploring the workspaceChapt 1 (part 2)   installing the sdk and exploring the workspace
Chapt 1 (part 2) installing the sdk and exploring the workspace
 
5707_10_auto-encoder.pptx
5707_10_auto-encoder.pptx5707_10_auto-encoder.pptx
5707_10_auto-encoder.pptx
 
memory_allocation_use1.ppt
memory_allocation_use1.pptmemory_allocation_use1.ppt
memory_allocation_use1.ppt
 
Different types of Bits, bytes, and representation of information1.pdf
Different types of Bits, bytes, and representation of information1.pdfDifferent types of Bits, bytes, and representation of information1.pdf
Different types of Bits, bytes, and representation of information1.pdf
 
The IoT Academy IoT training Arduino Part 5 Arduino peripherals
The IoT Academy IoT training Arduino Part 5 Arduino peripheralsThe IoT Academy IoT training Arduino Part 5 Arduino peripherals
The IoT Academy IoT training Arduino Part 5 Arduino peripherals
 
Digital signal processing through speech, hearing, and Python
Digital signal processing through speech, hearing, and PythonDigital signal processing through speech, hearing, and Python
Digital signal processing through speech, hearing, and Python
 
Audio_Overview.pptx
Audio_Overview.pptxAudio_Overview.pptx
Audio_Overview.pptx
 
lect01.ppt
lect01.pptlect01.ppt
lect01.ppt
 
Livecoding with impromptu
Livecoding with impromptuLivecoding with impromptu
Livecoding with impromptu
 
Michaelwilliamsig2task1worksheet
Michaelwilliamsig2task1worksheetMichaelwilliamsig2task1worksheet
Michaelwilliamsig2task1worksheet
 
Computer Programming and MCUs Assembly Language STM32Cu.pdf
Computer Programming and MCUs  Assembly Language  STM32Cu.pdfComputer Programming and MCUs  Assembly Language  STM32Cu.pdf
Computer Programming and MCUs Assembly Language STM32Cu.pdf
 
IG2 Task 1
IG2 Task 1 IG2 Task 1
IG2 Task 1
 
Paper on Modeling and Subtractive synthesis of virtual violin
Paper on Modeling and Subtractive synthesis of virtual violinPaper on Modeling and Subtractive synthesis of virtual violin
Paper on Modeling and Subtractive synthesis of virtual violin
 
Adam copeland ig2 task 1 work sheet
Adam copeland ig2 task 1 work sheetAdam copeland ig2 task 1 work sheet
Adam copeland ig2 task 1 work sheet
 
Adam copeland ig2 task 1 work sheet
Adam copeland ig2 task 1 work sheetAdam copeland ig2 task 1 work sheet
Adam copeland ig2 task 1 work sheet
 
Adam copeland ig2 task 1 work sheet
Adam copeland ig2 task 1 work sheetAdam copeland ig2 task 1 work sheet
Adam copeland ig2 task 1 work sheet
 

More from arihanthtextiles

I need help writing the methods for the song and playList class in J.pdf
I need help writing the methods for the song and playList class in J.pdfI need help writing the methods for the song and playList class in J.pdf
I need help writing the methods for the song and playList class in J.pdf
arihanthtextiles
 
How do autopolyploidy and allopolyploidy differ Only autopolyploidy.pdf
How do autopolyploidy and allopolyploidy differ  Only autopolyploidy.pdfHow do autopolyploidy and allopolyploidy differ  Only autopolyploidy.pdf
How do autopolyploidy and allopolyploidy differ Only autopolyploidy.pdf
arihanthtextiles
 
How do you find the order of growth for the following recurrenceT.pdf
How do you find the order of growth for the following recurrenceT.pdfHow do you find the order of growth for the following recurrenceT.pdf
How do you find the order of growth for the following recurrenceT.pdf
arihanthtextiles
 
Explain SEAD, SAR and SPAAR routing protocols in more details.So.pdf
Explain SEAD, SAR and SPAAR routing protocols in more details.So.pdfExplain SEAD, SAR and SPAAR routing protocols in more details.So.pdf
Explain SEAD, SAR and SPAAR routing protocols in more details.So.pdf
arihanthtextiles
 
Dynamic routing protocols are used toa) establish paths real ti.pdf
Dynamic routing protocols are used toa) establish paths real ti.pdfDynamic routing protocols are used toa) establish paths real ti.pdf
Dynamic routing protocols are used toa) establish paths real ti.pdf
arihanthtextiles
 
Evaluate expression without a calculator. Write answer in radians..pdf
Evaluate expression without a calculator. Write answer in radians..pdfEvaluate expression without a calculator. Write answer in radians..pdf
Evaluate expression without a calculator. Write answer in radians..pdf
arihanthtextiles
 
Epithelial tissues that are only one cell thick are called _____ Epi.pdf
Epithelial tissues that are only one cell thick are called _____  Epi.pdfEpithelial tissues that are only one cell thick are called _____  Epi.pdf
Epithelial tissues that are only one cell thick are called _____ Epi.pdf
arihanthtextiles
 
Describe in five sentences how the TLR system is used to fight HSV-1 .pdf
Describe in five sentences how the TLR system is used to fight HSV-1 .pdfDescribe in five sentences how the TLR system is used to fight HSV-1 .pdf
Describe in five sentences how the TLR system is used to fight HSV-1 .pdf
arihanthtextiles
 
Daunte is frustrated about managements recent decision to merge hi.pdf
Daunte is frustrated about managements recent decision to merge hi.pdfDaunte is frustrated about managements recent decision to merge hi.pdf
Daunte is frustrated about managements recent decision to merge hi.pdf
arihanthtextiles
 
Concern over the weather associated with El Nino has increased intere.pdf
Concern over the weather associated with El Nino has increased intere.pdfConcern over the weather associated with El Nino has increased intere.pdf
Concern over the weather associated with El Nino has increased intere.pdf
arihanthtextiles
 
Clostridium difficile is a bacteria currently making headlines. It h.pdf
Clostridium difficile is a bacteria currently making headlines. It h.pdfClostridium difficile is a bacteria currently making headlines. It h.pdf
Clostridium difficile is a bacteria currently making headlines. It h.pdf
arihanthtextiles
 
You cloned an EcoRI digested DNA fragment into a unique EcoRI site o.pdf
You cloned an EcoRI digested DNA fragment into a unique EcoRI site o.pdfYou cloned an EcoRI digested DNA fragment into a unique EcoRI site o.pdf
You cloned an EcoRI digested DNA fragment into a unique EcoRI site o.pdf
arihanthtextiles
 
You have constructed a new reporter gene to help you find novel zebr.pdf
You have constructed a new reporter gene to help you find novel zebr.pdfYou have constructed a new reporter gene to help you find novel zebr.pdf
You have constructed a new reporter gene to help you find novel zebr.pdf
arihanthtextiles
 
Write a Java program that will incorporate either a sequential searc.pdf
Write a Java program that will incorporate either a sequential searc.pdfWrite a Java program that will incorporate either a sequential searc.pdf
Write a Java program that will incorporate either a sequential searc.pdf
arihanthtextiles
 
Answer only with excel instructions.Assume that 96 of ticket hold.pdf
Answer only with excel instructions.Assume that 96 of ticket hold.pdfAnswer only with excel instructions.Assume that 96 of ticket hold.pdf
Answer only with excel instructions.Assume that 96 of ticket hold.pdf
arihanthtextiles
 
A new species of sea horse has been discovered and is being sequenced.pdf
A new species of sea horse has been discovered and is being sequenced.pdfA new species of sea horse has been discovered and is being sequenced.pdf
A new species of sea horse has been discovered and is being sequenced.pdf
arihanthtextiles
 
Which of the following is the mechanism of action for Herceptin Her.pdf
Which of the following is the mechanism of action for Herceptin  Her.pdfWhich of the following is the mechanism of action for Herceptin  Her.pdf
Which of the following is the mechanism of action for Herceptin Her.pdf
arihanthtextiles
 
Which of these statements best describes an element An element is c.pdf
Which of these statements best describes an element  An element is c.pdfWhich of these statements best describes an element  An element is c.pdf
Which of these statements best describes an element An element is c.pdf
arihanthtextiles
 
What is the general goal for descriptive statistics How is the goal.pdf
What is the general goal for descriptive statistics  How is the goal.pdfWhat is the general goal for descriptive statistics  How is the goal.pdf
What is the general goal for descriptive statistics How is the goal.pdf
arihanthtextiles
 
What effects are shown on this graph (assume that all effects where.pdf
What effects are shown on this graph (assume that all effects where.pdfWhat effects are shown on this graph (assume that all effects where.pdf
What effects are shown on this graph (assume that all effects where.pdf
arihanthtextiles
 

More from arihanthtextiles (20)

I need help writing the methods for the song and playList class in J.pdf
I need help writing the methods for the song and playList class in J.pdfI need help writing the methods for the song and playList class in J.pdf
I need help writing the methods for the song and playList class in J.pdf
 
How do autopolyploidy and allopolyploidy differ Only autopolyploidy.pdf
How do autopolyploidy and allopolyploidy differ  Only autopolyploidy.pdfHow do autopolyploidy and allopolyploidy differ  Only autopolyploidy.pdf
How do autopolyploidy and allopolyploidy differ Only autopolyploidy.pdf
 
How do you find the order of growth for the following recurrenceT.pdf
How do you find the order of growth for the following recurrenceT.pdfHow do you find the order of growth for the following recurrenceT.pdf
How do you find the order of growth for the following recurrenceT.pdf
 
Explain SEAD, SAR and SPAAR routing protocols in more details.So.pdf
Explain SEAD, SAR and SPAAR routing protocols in more details.So.pdfExplain SEAD, SAR and SPAAR routing protocols in more details.So.pdf
Explain SEAD, SAR and SPAAR routing protocols in more details.So.pdf
 
Dynamic routing protocols are used toa) establish paths real ti.pdf
Dynamic routing protocols are used toa) establish paths real ti.pdfDynamic routing protocols are used toa) establish paths real ti.pdf
Dynamic routing protocols are used toa) establish paths real ti.pdf
 
Evaluate expression without a calculator. Write answer in radians..pdf
Evaluate expression without a calculator. Write answer in radians..pdfEvaluate expression without a calculator. Write answer in radians..pdf
Evaluate expression without a calculator. Write answer in radians..pdf
 
Epithelial tissues that are only one cell thick are called _____ Epi.pdf
Epithelial tissues that are only one cell thick are called _____  Epi.pdfEpithelial tissues that are only one cell thick are called _____  Epi.pdf
Epithelial tissues that are only one cell thick are called _____ Epi.pdf
 
Describe in five sentences how the TLR system is used to fight HSV-1 .pdf
Describe in five sentences how the TLR system is used to fight HSV-1 .pdfDescribe in five sentences how the TLR system is used to fight HSV-1 .pdf
Describe in five sentences how the TLR system is used to fight HSV-1 .pdf
 
Daunte is frustrated about managements recent decision to merge hi.pdf
Daunte is frustrated about managements recent decision to merge hi.pdfDaunte is frustrated about managements recent decision to merge hi.pdf
Daunte is frustrated about managements recent decision to merge hi.pdf
 
Concern over the weather associated with El Nino has increased intere.pdf
Concern over the weather associated with El Nino has increased intere.pdfConcern over the weather associated with El Nino has increased intere.pdf
Concern over the weather associated with El Nino has increased intere.pdf
 
Clostridium difficile is a bacteria currently making headlines. It h.pdf
Clostridium difficile is a bacteria currently making headlines. It h.pdfClostridium difficile is a bacteria currently making headlines. It h.pdf
Clostridium difficile is a bacteria currently making headlines. It h.pdf
 
You cloned an EcoRI digested DNA fragment into a unique EcoRI site o.pdf
You cloned an EcoRI digested DNA fragment into a unique EcoRI site o.pdfYou cloned an EcoRI digested DNA fragment into a unique EcoRI site o.pdf
You cloned an EcoRI digested DNA fragment into a unique EcoRI site o.pdf
 
You have constructed a new reporter gene to help you find novel zebr.pdf
You have constructed a new reporter gene to help you find novel zebr.pdfYou have constructed a new reporter gene to help you find novel zebr.pdf
You have constructed a new reporter gene to help you find novel zebr.pdf
 
Write a Java program that will incorporate either a sequential searc.pdf
Write a Java program that will incorporate either a sequential searc.pdfWrite a Java program that will incorporate either a sequential searc.pdf
Write a Java program that will incorporate either a sequential searc.pdf
 
Answer only with excel instructions.Assume that 96 of ticket hold.pdf
Answer only with excel instructions.Assume that 96 of ticket hold.pdfAnswer only with excel instructions.Assume that 96 of ticket hold.pdf
Answer only with excel instructions.Assume that 96 of ticket hold.pdf
 
A new species of sea horse has been discovered and is being sequenced.pdf
A new species of sea horse has been discovered and is being sequenced.pdfA new species of sea horse has been discovered and is being sequenced.pdf
A new species of sea horse has been discovered and is being sequenced.pdf
 
Which of the following is the mechanism of action for Herceptin Her.pdf
Which of the following is the mechanism of action for Herceptin  Her.pdfWhich of the following is the mechanism of action for Herceptin  Her.pdf
Which of the following is the mechanism of action for Herceptin Her.pdf
 
Which of these statements best describes an element An element is c.pdf
Which of these statements best describes an element  An element is c.pdfWhich of these statements best describes an element  An element is c.pdf
Which of these statements best describes an element An element is c.pdf
 
What is the general goal for descriptive statistics How is the goal.pdf
What is the general goal for descriptive statistics  How is the goal.pdfWhat is the general goal for descriptive statistics  How is the goal.pdf
What is the general goal for descriptive statistics How is the goal.pdf
 
What effects are shown on this graph (assume that all effects where.pdf
What effects are shown on this graph (assume that all effects where.pdfWhat effects are shown on this graph (assume that all effects where.pdf
What effects are shown on this graph (assume that all effects where.pdf
 

Recently uploaded

CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
Marketing internship report file for MBA
Marketing internship report file for MBAMarketing internship report file for MBA
Marketing internship report file for MBA
gb193092
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Dr. Vinod Kumar Kanvaria
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 

Recently uploaded (20)

CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
Marketing internship report file for MBA
Marketing internship report file for MBAMarketing internship report file for MBA
Marketing internship report file for MBA
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 

Programming in C.Create a program which turns your Arduino into a .pdf

  • 1. Programming in C. Create a program which turns your Arduino into a light based electronic instrument. The program should play music based on the amount of light hitting the optical sensor. There should be a way to capture particularly pleasing tones and play those tones back in the order they are captured. The program must utilize the following : • An array to hold the stored tones • A function : void read_buttons( int *sw1, int *sw2, int *sw3, int *sw4) to read and store the state of the four buttons on the board • A function playback( notes[] ) which plays back the notes stored • A function clear_playlist( *notes) which clears the stored tones • A function tone_value() which generates a tone based on the current state of the optical sensor • The possible tones should span the range of human hearing Solution #include #include using namespace std; // Class Declaration class prime { //Member Varibale Declaration int a,k,i; public: prime(int x) { a=x; } // Object Creation For Class void calculate() { k=1; { for(i=2;i<=a/2;i++)
  • 2. if(a%i==0) { k=0; break; } else { k=1; } } } void show() { if(k==1) cout<<" "<>a; // Object Creation For Class prime obj(a); // Call Member Functions obj.calculate(); obj.show(); getch(); return 0; }