Posts

Showing posts from February, 2024

Arduino Tutorial | Digital Read Serial

Image
Arduino Tutorial | Digital Read Serial This example shows you how to monitor the state of a switch by establishing  serial communication  between your Arduino or Genuino and your computer over USB. Hardware Required Arduino or Genuino Board A momentary switch, button, or toggle switch 10k ohm resistor hook-up wires breadboard Circuit image developed using  Fritzing  . For more circuit examples, see the  Fritzing project page Connect three wires to the board. The first two, red and black, connect to the two long vertical rows on the side of the breadboard to provide access to the 5 volt supply and ground. The third wire goes from digital pin 2 to one leg of the pushbutton. That same leg of the button connects through a pull-down resistor (here 10k ohm) to ground. The other leg of the button connects to the 5 volt supply. Pushbuttons or switches connect two points in a circuit when you press them. When the pushbutton is open (unpressed) there is no connection betw...

Arduino Tutorial | Blink

Image
  Arduino Tutorial |   Blink Mr.Easy Arduino, This example shows the simplest thing you can do with an Arduino or Genuino to see physical output: it blinks an LED. Hardware Required Arduino or Genuino Board LED 220 ohm resistor Circuit To build the circuit, connect one end of the resistor to Arduino pin 13. Connect the long leg of the LED (the positive leg, called the anode) to the other end of the resistor. Connect the short leg of the LED (the negative leg, called the cathode) to the Arduino GND, as shown in the diagram and the schematic below. Most Arduino boards already have an LED attached to pin 13 on the board itself. If you run this example with no hardware attached, you should see that LED blink. The value of the resistor in series with the LED may be of a different value than 220 ohm; the LED will lit up also with values up to 1K ohm. Schematic Code After you build the circuit plug your Arduino or Genuino board into your computer, start the Arduino Software (IDE) and...

Arduino Tutorial | Bare Minimum code needed

Image
Arduino Tutorial |  Bare Minimum code needed Mr.Easy Arduino, This example contains the bare minimum of code you need for a sketch to compile properly on Arduino Software (IDE): the  setup()  method and the  loop()  method. Hardware Required ◆ Arduino or Genuino Board Circuit Only your Arduino or Genuino Board is needed for this example. image developed using  Fritzing  . For more circuit examples, see the  Fritzing project page Code The  setup()  function is called when a sketch starts. Use it to initialize variables, pin modes, start using libraries, etc. The setup function will only run once, after each powerup or reset of the board. After creating a  setup()  function, the  loop()  function does precisely what its name suggests, and loops consecutively, allowing your program to change and respond as it runs. Code in the  loop()  section of your sketch is used to actively control the board. The code below...