Arduino digitalRead Serial Monitor with Button

  Рет қаралды 66,648

Maker 101

Maker 101

Күн бұрын

Arduino Basic Tutorial digitalRead Serial Monitor with Button. Reads a digital input on pin 2, prints the result to the serial monitor.
When the pushbutton is open (unpressed) there is no connection between the two legs of the pushbutton, so the pin is connected to ground (through the pull-down resistor) and reads as LOW, or 0.
When the button is closed (pressed), it makes a connection between its two legs, connecting the pin to 5 volts, so that the pin reads as HIGH, or 1.
Required Hardware
Arduino Board: amzn.to/2LZr6t4
Push Button: amzn.to/3k79Bnh
10k ohm Resistor: amzn.to/3bj2HY9
Jumper Wires: amzn.to/3doetmT
Breadboard: amzn.to/3qxLxwm
Recommended Items:
Use Your Muscles in Project - amzn.to/3wdL45C
37 Sensor & Module Packages - amzn.to/3m66WeQ
Try this Robot Arm - amzn.to/3fq8DCl
Best Resin 3D Printer - amzn.to/39tY8KB
Arduino Compatible Kits - bit.ly/2J2AFF7
Banggood Spring Sale - bit.ly/3slMbOn
Connections
One leg of the button connect a resistor.
Green wire connect from digital pin 2 to one leg of the pushbutton.
Leg of the resistor to ground.
The other leg of the button connects to the 5 volt supply.
Source Code: create.arduino...
Social Media:
/ mertarduino
/ mertarduino

Пікірлер: 33
@maker101io
@maker101io 3 жыл бұрын
Source Code: create.arduino.cc/editor/mertarduinotech/d9916b75-3ef3-4da5-bf70-272a8b39eb03/preview Recommended Items: Use Your Muscles in Project - amzn.to/3wdL45C​ 37 Sensor & Module Packages - amzn.to/3m66WeQ​ Try this Robot Arm - amzn.to/3fq8DCl​ Best Resin 3D Printer - amzn.to/39tY8KB​ Arduino Compatible Kits - bit.ly/2J2AFF7​ Banggood Spring Sale - bit.ly/3slMbOn
@roselinvarsha5377
@roselinvarsha5377 Ай бұрын
No
@robertosalgado8339
@robertosalgado8339 6 жыл бұрын
Friend, thank you very much. This video of yours has saved me the semester in school, it has saved me from a fight with classmates and I may even get a girlfriend. You're the best. You have a new subscriber and lifelong admirer.
@kaanekz
@kaanekz 8 жыл бұрын
Bütün gün aradım buldum sende oldugunu daha yeni görüyorum bundan sonra ilk sana bakacağım 😂 ( internette çok karmaşıkları var ve dataylı anlatım yok tebrikler )
@abhijaypratapsinghtanwar9242
@abhijaypratapsinghtanwar9242 4 жыл бұрын
Great video man total rocking I was inspired by this video dude!!!!!
@abdelrahmanellithy6499
@abdelrahmanellithy6499 8 жыл бұрын
I have a question to ask, please How does the pin(2) attached to the third leg realizes that the two legs of the push button are connected when the button is pressed ?!! in another form: How does the 4-legs are connected to each others ? thank you
@josephmazzulla646
@josephmazzulla646 7 жыл бұрын
nice guitar playing
@lastchance045
@lastchance045 5 жыл бұрын
Connections: Switch: left side vertical pins (1 & 2). Connect pin 1 to 5v, pin 2 no connect. Switch: right side vertical pins (3 & 4). Connect pin 3 to R1 (10K). Connect R1's other end to Gnd Connect switch pin 4 to Arduino pin 2 /*Digital Read with Button: Upload sketch then open Serial Monitor (9600): a "0" will appear on each update. If the button is pushed a "1 will appear on each update until the button is released. Close the Serial Monitor & open the Serial Plotter (Tools, Serial Plotter). A trace line will appear indicating "0" level. Push & hold the button. The trace line will now indicate "1" until the button is released */ int pushButton = 2; void setup () { Serial.begin (9600); pinMode (pushButton, INPUT); } void loop () { int buttonState = digitalRead (pushButton); //read input pin Serial.println (buttonState); // print state of button delay (1); }
@namesare4fools
@namesare4fools 7 жыл бұрын
i LoVe your videos.. & the music u used
@pccxp
@pccxp 11 ай бұрын
Hi, I started doing the same on my Arduino, But I'm trying to read if the LED is ON (1) or OFF (2), But i cant make it work :(
@PP-yg6ll
@PP-yg6ll 3 жыл бұрын
how to serial monitor two button? press button 1- monitor 1, if press button 2- monitor 2...
@taranagnew436
@taranagnew436 6 жыл бұрын
can you do the same code but with a LCD shield and have the serial monitor read the buttons on a LCD shield?
@silentsniper9531
@silentsniper9531 5 жыл бұрын
My curve looks very different, unfortunately. When I don't touch it, it draws something similar do a sin-wave. When I press the button, the amplitude is zero. Where did I do something wrong?
@teamzawafootball1370
@teamzawafootball1370 4 жыл бұрын
I have the same result, still don't know why
@chirayuagrawal3317
@chirayuagrawal3317 6 жыл бұрын
Thanks for your help!!
@qzorn4440
@qzorn4440 2 жыл бұрын
sweet video, would this be good to test the esp32 port serial2 with a rs485 ttl module? 😊 thank you
@gokhancan5054
@gokhancan5054 7 жыл бұрын
İşte TÜRK'ün gücü.
@mightydead7151
@mightydead7151 6 жыл бұрын
sir why are you add 10k ohm resister with button to ground reply please i want to know
@Arthurk346
@Arthurk346 5 жыл бұрын
i tried once grounding 5v directly to GND without resistor and arduino rebooted right when i pressed the button (i guess safety feature). hopefully it survived but i dont want to repeat the process again haha
@coringavinte5105
@coringavinte5105 6 жыл бұрын
perfect video
@ahmetberakarasoy2553
@ahmetberakarasoy2553 4 жыл бұрын
Kralsın allah razı olsun kaç saattir bunu ariyom
@suloman5845
@suloman5845 6 жыл бұрын
merhabalar hocam.bir projem için sizden yardım isticem. motosikletim için arduino üzerine kurulu bir ekran projesi yaptım sonlandırdım ancak button eklemem lazım su geçirmez falan olsun istiyorum aliexpresste görebildiğim kadarıyla on/off durumlu buttonlar var bu arduinoda kulllandığımız gibi çıtçıtlı digital veri alabildiğimiz buttonlardan yok. sizce nasıl bir yol izlemeliyim?
@engjawad8645
@engjawad8645 3 жыл бұрын
It is so difficult for those watching ur vedio through the mobile to see the code .
@rjnmex
@rjnmex 6 жыл бұрын
Thanks!!
@kartiksingh9382
@kartiksingh9382 8 жыл бұрын
kindly don't forget the esp8266 robo
@gijsvanderburgh1556
@gijsvanderburgh1556 5 жыл бұрын
Thanks
@Unkn0wnTimes
@Unkn0wnTimes 7 жыл бұрын
why did you use 10K ohm? reason?
@matiasfurnes4834
@matiasfurnes4834 6 жыл бұрын
If you dont, you shorting the Adiono board beween the pluss and minus terminal. And that is bad for the Arduino board.
@diyrobotronics
@diyrobotronics 3 жыл бұрын
🔥🔥
@_red_shift
@_red_shift 7 жыл бұрын
i wanna get circuit please give me them.
@saseeka-weerasinghe
@saseeka-weerasinghe 5 жыл бұрын
tnx bro
@bob-ny6kn
@bob-ny6kn 2 жыл бұрын
One minute to put a button on a board? F*
@김사장-s1v
@김사장-s1v 7 ай бұрын
fxxckjing I haven't understand yet.
Arduino Uno Gets Its BIGGEST Upgrade In 12 Years
11:49
Electronoobs
Рет қаралды 92 М.
Arduino - Digital Inputs
12:30
The Machine Shop
Рет қаралды 13 М.
СИНИЙ ИНЕЙ УЖЕ ВЫШЕЛ!❄️
01:01
DO$HIK
Рет қаралды 3,3 МЛН
小丑教训坏蛋 #小丑 #天使 #shorts
00:49
好人小丑
Рет қаралды 54 МЛН
She made herself an ear of corn from his marmalade candies🌽🌽🌽
00:38
Valja & Maxim Family
Рет қаралды 18 МЛН
Serial Communication with Arduino - The details!
16:51
Programming Electronics Academy
Рет қаралды 68 М.
EEPROM Memory - Store Anything - Arduino101
13:16
Electronoobs
Рет қаралды 114 М.
Playing Music on the Oldest Running Computer in America!
27:06
Usagi Electric
Рет қаралды 377 М.
I built an Omni-Directional Ball-Wheeled Bike
27:55
James Bruton
Рет қаралды 3,9 МЛН
Arduino - Turn LED On and Off With Push Button
23:33
Robotics Back-End
Рет қаралды 145 М.
The Best 20 Arduino Projects of the year 2024!
14:59
ToP Projects Compilation
Рет қаралды 138 М.
Converting devices to USB Type-C
16:25
DIY Perks
Рет қаралды 7 МЛН
Arduino - Send Commands with Serial Communication
17:23
Eli the Computer Guy
Рет қаралды 53 М.
Using Serial.read() with Arduino | Part 1
10:30
Programming Electronics Academy
Рет қаралды 142 М.
СИНИЙ ИНЕЙ УЖЕ ВЫШЕЛ!❄️
01:01
DO$HIK
Рет қаралды 3,3 МЛН