1 #include 2 3 float Digitized Volt =0; 4 int Lux =0; 5 int Servo_angle = 0; 6 7 Servo servo_11; 8 9 void setup() 10 11 { 12 13 14} 15 Serial.begin(9600); pinMode (AO, INPUT); servo 11.attach (11); 16 void loop() 17 { ((analogRead(AO)) 0.0048828125); 18 Digitized Volt = ((analogRead (A0)) 19 20 Lux = (2500/DigitizedVolt - 500)/3.3; 21 Servo_angle = map (Lux, 0, 225, 0, 180); 22 servo 11.write(Servo_angle); 23 24 Serial.print(Lux); 25 Serial.println(" Lux"); 26 Serial.print (Servo_angle); 27 Serial.println(" Degree"); 28 29 delay(1000); 30 31}

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter8: Advanced Data Handling Concepts
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

can you explain the purpose of the following lines of code.
line:
1, 5, 7, 11, 12, 16, 18, 21, 26, 29

1 #include <Servo.h>
2
3 float Digitized Volt =0;
4 int Lux =0;
5 int Servo_angle = 0;
6
7 Servo servo_11;
8
9 void setup()
10
11
{
12
13
14}
15
Serial.begin(9600);
pinMode (AO, INPUT);
servo 11.attach (11);
16 void loop()
17 {
((analogRead(AO)) 0.0048828125);
18 Digitized Volt = ((analogRead (A0))
19
20 Lux = (2500/DigitizedVolt - 500)/3.3;
21 Servo_angle = map (Lux, 0, 225, 0, 180);
22 servo 11.write(Servo_angle);
23
24 Serial.print(Lux);
25 Serial.println(" Lux");
26 Serial.print (Servo_angle);
27 Serial.println(" Degree");
28
29 delay(1000);
30
31}
Transcribed Image Text:1 #include <Servo.h> 2 3 float Digitized Volt =0; 4 int Lux =0; 5 int Servo_angle = 0; 6 7 Servo servo_11; 8 9 void setup() 10 11 { 12 13 14} 15 Serial.begin(9600); pinMode (AO, INPUT); servo 11.attach (11); 16 void loop() 17 { ((analogRead(AO)) 0.0048828125); 18 Digitized Volt = ((analogRead (A0)) 19 20 Lux = (2500/DigitizedVolt - 500)/3.3; 21 Servo_angle = map (Lux, 0, 225, 0, 180); 22 servo 11.write(Servo_angle); 23 24 Serial.print(Lux); 25 Serial.println(" Lux"); 26 Serial.print (Servo_angle); 27 Serial.println(" Degree"); 28 29 delay(1000); 30 31}
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage