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
Czy FALL GUYS będzie działało szybko na i5 GH8? Na ilu FPS?
Lesechka [4]

Answer:español por favor asi te responderé y gracias por los 10 puntos chaoo

Explanation:

6 0
3 years ago
Ms office suite comes with its own set of pictures in the​
goldfiish [28.3K]

Answer:

clipart ...........................

Explanation:

clipart is the correct answer for the above question.

6 0
3 years ago
Modify the code below to do the following:
Kitty [74]

Answer:

The code is appropriately given below with comments for better understanding

Explanation:

#include <linux/init.h>

#include <linux/module.h>

#include <linux/kernel.h>

#include <linux/hash.h>

#include <linux/gcd.h>

#include <asm/param.h>

#include <linux/jiffies.h>

/* This function is called when the module is loaded. */

static int simple_init(void)

{

  printk(KERN_INFO "Loading Module\n");

  printk(KERN_INFO "These are the HZ: %d\n", HZ);

  printk(KERN_INFO "These are the jiffies: %lu\n", jiffies);

  printk(KERN_INFO "Golden Ratio is: %lu\n", GOLDEN_RATIO_PRIME);  

  return 0;

}

/* This function is called when the module is removed. */

static void simple_exit(void) {

  printk(KERN_INFO "Removing Module");

  unsigned long a = gcd(3300, 24);

  printk(KERN_INFO "Greatest Common Denominator between 3,300 and 24 is: %lu\n", a);

  printk(KERN_INFO "These are the jiffies: %lu\n", jiffies);

}

/* Macros for registering module entry and exit points. */

module_init( simple_init );

module_exit( simple_exit );

MODULE_LICENSE("GPL");

MODULE_DESCRIPTION("Simple Module");

MODULE_AUTHOR("SGG");

7 0
3 years ago
The while loop and the do loop are equivalent in their expressive power; in other words, you can rewrite a while loop using a do
sleet_krkn [62]
I think False...

I hope this helps
8 0
2 years ago
Computers that are close to one another are connected to form a LAN
Archy [21]

Explanation:

different computer are connected to a LAN by a cable and an interface card

6 0
3 years ago
Other questions:
  • Define a function begins_with_line that consumes a string and returns a boolean indicating whether the string begins with a dash
    15·1 answer
  • If I put a short clip from a copyrighted video to Facebook and make it only viewable to friends, is that illegal?
    12·1 answer
  • What can be done to improve the security of business uses of the Internet? Give several examples of ecurity measures and technol
    9·1 answer
  • 3. Find the product of (a² +3a+5) x (a+7)​
    7·1 answer
  • Write a program to generate following series in qbasics 100,81,64,....1​
    13·1 answer
  • You are splitting up all your apples equally between 3 people. which statement below will calculate how many apples will be left
    12·1 answer
  • Describa la clasificación de los recursos educativos digitales abiertos. vea este video, para hacer eso
    11·2 answers
  • Your program will be used by many departments at the university. Your comments will be important to their IT people. What would
    13·1 answer
  • E commerce is the demand of modern society both for time and money
    14·2 answers
  • A drive is small enough to be carried in one's pocket.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!