Question: 3 The function unsigned char AnalogRead ( unsigned char pin ) ; reads the voltage value at pin and convert the voltage to digital value

3 The function
unsigned char AnalogRead(unsigned char pin);
reads the voltage value at pin and convert the voltage to digital value from 0 to 255
Write a function
unsigned char CheckTemperature( void );
(a) Call the function AnalogRead() to read the voltage at analog pin A1 and assign the return value to a variable value;
(b) Check if value is more than 100. If true return 1; and
(c) Check if value is less than or equal to 70. If true, return 0.
You are to declare any variables you use.
(5 marks)
4 Write codes in the void setup() to initialise the following:
(a) Initialise the Serial port to operate at 9600bps;
(b) Digital pin D5, D8 and D11,
(c) Wait for swo to be closed; -
For 1.4(c) you are to call the function in 1.1
(4 marks)
.5 Write codes in the forever loop assisted by the following comments:You are to declare any variables you used.
void loop ()
14
???
(a) Call the function GhegkTemperature() to assign thet
???
return value to a variable state
//
(b) Send the value of state to Serial port
J
 3 The function unsigned char AnalogRead(unsigned char pin); reads the voltage

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!