explain each code line. all the details

EBK JAVA PROGRAMMING
8th Edition
ISBN:9781305480537
Author:FARRELL
Publisher:FARRELL
Chapter2: Using Data
Section: Chapter Questions
Problem 12PE
icon
Related questions
Question

explain each code line. all the details.

233 ♡ ♡ ♡ ♡ ♡
29
90L NO
30 // constants won't change. Used here to set a pin number :
31 const int ledPin = LED_BUILTIN; // the number of the LED pin
32
33 // Variables will change :
34 int ledState = LOW;
35
36 // Generally, you should use "unsigned long" for variables that hold time
37 // The value will quickly become too large for an int to store
// will store last time LED was updated
"455 10 10 10 10 10 556666666
38 unsigned long previousMillis = 0;
39
40 // constants won't change :
41 const long interval = 1000;
42
43 void setup() {
44
45 pinMode(ledPin, OUTPUT);
46 }
47
48 void loop() {
50
196 A WNTO
49 // here is where you'd put code that needs to be running all the time.
51
52
53
54
56
57
58
59
60
61
55 unsigned long currentMillis = millis();
62
63
64
65
66
// set the digital pin as output:
67
68
69
70
71
// ledState used to set the LED
// check to see if it's time to blink the LED; that is, if the
// difference between the current time and last time you blinked
// the LED is bigger than the interval at which you want to
// blink the LED.
}
// interval at which to blink (milliseconds)
if (currentMillis - previousMillis >= interval) {
// save the last time you blinked the LED
previousMillis: = currentMillis;
// if the LED is off turn it on and vice-versa:
if (ledState LOW) {
ledState = HIGH;
} else {
==
ledState = LOW;
}
Serial Monitor
}
// set the LED with the ledState of the variable:
digitalWrite(ledPin, ledState);
Transcribed Image Text:233 ♡ ♡ ♡ ♡ ♡ 29 90L NO 30 // constants won't change. Used here to set a pin number : 31 const int ledPin = LED_BUILTIN; // the number of the LED pin 32 33 // Variables will change : 34 int ledState = LOW; 35 36 // Generally, you should use "unsigned long" for variables that hold time 37 // The value will quickly become too large for an int to store // will store last time LED was updated "455 10 10 10 10 10 556666666 38 unsigned long previousMillis = 0; 39 40 // constants won't change : 41 const long interval = 1000; 42 43 void setup() { 44 45 pinMode(ledPin, OUTPUT); 46 } 47 48 void loop() { 50 196 A WNTO 49 // here is where you'd put code that needs to be running all the time. 51 52 53 54 56 57 58 59 60 61 55 unsigned long currentMillis = millis(); 62 63 64 65 66 // set the digital pin as output: 67 68 69 70 71 // ledState used to set the LED // check to see if it's time to blink the LED; that is, if the // difference between the current time and last time you blinked // the LED is bigger than the interval at which you want to // blink the LED. } // interval at which to blink (milliseconds) if (currentMillis - previousMillis >= interval) { // save the last time you blinked the LED previousMillis: = currentMillis; // if the LED is off turn it on and vice-versa: if (ledState LOW) { ledState = HIGH; } else { == ledState = LOW; } Serial Monitor } // set the LED with the ledState of the variable: digitalWrite(ledPin, ledState);
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Keywords
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,