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
Which of the following is likely the cause of the bass from a sound system rattling the windows on your car?
Andrei [34K]
The vibration of the sound system
4 0
3 years ago
15 points. Please give an actual answer and not some random thing. this is not just free points. Correct answer will receive bra
trapecia [35]

Answer:

i think its b

Explanation:

i did the test and got it right

7 0
3 years ago
Read 2 more answers
Text that is heavier or darker than other text in the document is considered _____.
kvv77 [185]

The text that is heavier or darker than other text in a document is considered  Bold.

Hope this helped!~

7 0
3 years ago
Read 2 more answers
How do i work on code with someone else? i use visual studio code. me and a friend wanna make a game together with code. how do
Art [367]

Answer:

You can use Repl.it.com......It's best for practising coding languages...

7 0
3 years ago
public class Test { public static void main(String[] args) { try { method(); System.out.println("After the method call"); } catc
USPshnik [31]

Answer:

"ArithmeticException" is the correct answer for the above question.

Explanation:

Missing Information : The above question does not hold that "what is the output of the program".

  • The above question has a class that holds the two functions one function is the main function which calls the other function in a try-catch block.
  • The method function holds one run time exception which is 1/0 which is an arithmetic exception.
  • It can be handle by the help of an arithmetic class object which is defined in the first catch block.
  • Hence the print function of this catch is executed and prints "ArithmeticException".
8 0
3 years ago
Other questions:
  • What should a career plan include?
    7·1 answer
  • What kind of firewall can block designated types of traffic based on application data contained within packets?
    7·1 answer
  • This measures how close a biometric reading is to a prerecorded template
    11·1 answer
  • This needs to be written in Java.
    11·1 answer
  • Sally needs to teach her class how to convert a decimal number to a binary number. What is the first step she should take to sta
    5·1 answer
  • ❤️❤️Please answer the six questions ✨BRAINIEST✨ For correct answer ❤️❤️
    7·1 answer
  • Use Spreadsheet Functions and Formulas
    6·1 answer
  • If you hard working right now go to this EASY question
    9·2 answers
  • !!! PLEASE HELP ASAP REALLY NEED IT !!!
    15·2 answers
  • 10.13 lab 10c: output range with increment of 5 write a program whose input is two integers. output the first integer and subseq
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!