Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2 . 4 Write codes in the void setupl to initialise the following: ( a ) Initialise the Serial port to operate at 9 6

2.4 Write codes in the void setupl to initialise the following:
(a) Initialise the Serial port to operate at 9600bps;-
(b) Digital pin D2, D3 and D12;
(c) Wait for SW0 to be press; and
(d) Send 2 characters '8' followed by 'S' via serial port to the Bluetooth module.
For (c) and (d), you are to call the respective functions in 2.1 and 2.3
(8 marks)
2.7 Write codes in the forever loop assisted by the following comments: You are to declare any variables you used.
void loop ()
// if the reading Erom PIR motion ia HIGH
// Sound the pizea buzzer
// Send a message 'x' To Bluetooth
+
(3 marks)
3(a) Write codes to set bit 5 and bit 7 of the 8-bit variable swVal to 1, with the rest of the bits of swdal,remains unchanged
(b) Write codes to clear bits 2,5 and 6 of the 8-bit variable numV a to 0, with the rest of the bits of pumbal. remains unchanged
4
(a) If the initial value in the variable num is 016, what will be the new value in the variable num after executing the following instruction? Show your working as necessary
num =( num 1)100;
(b) Write C-Statements to print the value of num on Serial Monitor as shown in Figure 1.1
Figure 1.1
Where NNNNNNNNN is the value of num in binary aner executing 4(a)
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Inference Control In Statistical Databases From Theory To Practice Lncs 2316

Authors: Josep Domingo-Ferrer

2002nd Edition

3540436146, 978-3540436140

More Books

Students also viewed these Databases questions

Question

Y = x

Answered: 1 week ago

Question

a. Recognize that internal attitudes can influence your message ?

Answered: 1 week ago

Question

Explain the various methods of job evaluation

Answered: 1 week ago

Question

Differentiate Personnel Management and Human Resource Management

Answered: 1 week ago

Question

Describe the functions of Human resource management

Answered: 1 week ago

Question

What are the objectives of Human resource planning ?

Answered: 1 week ago