Arduino Tutorial – Random Number Generator

What is Random Number Generator

  • Will Add Soon

 

Use of Random Number Generator

  • Will Add Soon

 

Prerequisites

Before start to learn, you should know below topics. If you know already, please go further

 

Components Required

  • Arduino  Uno Board (You Can use any other arduino boards*) – 1 Nos

 

Flow Chart

  • Will add soon

 

Code


 Code Explanation

  • Variable declaration & initialization
    • speakerPin  declared as int  (integer) type and initialized 12th Digital pin of arduino Uno board.
    • photocellPin  declared as int  (integer) type and initialized 0th Analog pin of arduino Uno board.
  • Continuous while loop (Setup Function)
    • reading  declared as int  (integer) type and read the analog value from  photocellPin  integer variable of 0th pin in Arduino Uno Board using  analogRead() function.
    • pitch  declared as int  (integer) type and dived the value 4 of analog read value with add 200 decimal value. Because make a beautiful tone sound for this calculation added.
    • Call the function Tone()  with arguments speakerPin  and pitch  values, this call function make a beautiful sound depends upon the LDR value with your hand movements.

 

Reference

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

if you have any queries call us +918300026060 or WhatsApp Dismiss

0

Your Cart

%d bloggers like this: