1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
ira [324]
3 years ago
14

Write modified code that will generate a random number between 0 and 255 when a button is pressed and will write the number to t

he serial monitor as well as to the receiver Arduino.
Computers and Technology
1 answer:
kobusy [5.1K]3 years ago
8 0

Solution :

#include<LiquidCrystal.h>

int value;

int flag;

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup()

{

lcd.begin(16, 2);

Serial.begin(9600);

}

void loop()

{

value=digitalRead(7);

  if(value==0){

flag=1;}

  if(value==1){

flag=~flag;}

  if (flag==1){

lcd.setCursor(0,0);    

  lcd.print("number is");

lcd.setCursor(2,1);    

lcd.print(random(0, 255));

delay(1000);

}

  else{

lcd.setCursor(0,0);

lcd.print("Not Pressed");

delay(1000);

lcd.clear();}

}

You might be interested in
people illegally download music over the internet although it's free it it is still illegal what do you choose to do? why
kodGreya [7K]

Answer:

its A i just did that

Explanation:

4 0
3 years ago
What does Falstaff do to protect himself in battle? ​
notka56 [123]
Bark bark bark bark bark bark bark bark bark bark bark bark bark bark bark bark bark bark bark bark bark bark bark
3 0
3 years ago
Which of the following postfix expressions corresponds to the given infix expression?
Ivan

Answer:

C) 1 4 2 / + 1 + 2 + 3 * 2 /

Explanation:

Infix, Postfix and Prefix are 3 different ways of writing expressions which differ in relative placement of operator and operands.

In Infix , operator lies between the operands whereas in postfix operator is written after its operands.

For example: 1 + 2 is infix while 1 2 + is the corresponding postfix expression.

Converting the given infix expression (1 + 4 / 2 + 1 + 2) * 3 / 2 to postfix:

Let (1 + 4 / 2 + 1 + 2) be represented by x.

Converting x to postfix:

(1 + 4 / 2 + 1 + 2)  =>  1 4 2 / + 1 + 2 +       ------------------------- (1)

So the overall infix expression becomes:

x * 3 / 2

Converting it to postfix:

x 3 * 2 /

Replacing the value of x from (1)

1 4 2 / + 1 + 2 + 3 * 2 /

4 0
3 years ago
Describe the three criteria you should use to determine if an online media source should be included in your paper or presentati
VikaD [51]
<span>To use an online resource, it should be relevant to the topic. It should be credible, coming from an expert on the topic. Finally, it should be valid, coming from a source that is based in truth or fact.</span>
7 0
3 years ago
Read 2 more answers
What uses HTML hypertext links that users can click to access different locations or information?
zalisa [80]

Answer:

a button

Explanation:

I am not too familiar with HTML terminology (self-taught), but button (classes?) use hypertext links to access different locations on a website.

I'm pretty sure the syntax is something like <button = *stuff*>

4 0
3 years ago
Other questions:
  • "In about 100 words, describe the idea behind software as a service (SaaS). In your answer, include at least three examples of e
    10·1 answer
  • Some careers emerge to address the environmental impact human behaviors and processes might be having on our planet. True False
    9·2 answers
  • What is the full form of PDP​
    7·1 answer
  • Question 19 :Rachel, a database administrator, has created a database for her website. It contains pictures of vacations that pe
    13·1 answer
  • A teacher wants a program to give extra points to students who fail a test. Write a Python program to do the following: (a) Ask
    5·1 answer
  • In computer science, what are two names that are used to describe data structures organized by association
    6·1 answer
  • When should you save your document?
    15·2 answers
  • Reesa works for a large real estate company. She is responsible for installing and supporting the company's internet systems, in
    5·1 answer
  • List and explain three computing devices from the 20th century​
    13·2 answers
  • It is a single strand of metal capable of transmitting power or data from one area to<br> another
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!