У нас вы можете посмотреть бесплатно Tutorial 09: How to read voltages with analogRead(): Arduino Course for Absolute Beginners (ReM) или скачать в максимальном доступном качестве, видео которое было загружено на ютуб. Для загрузки выберите вариант из формы ниже:
Если кнопки скачивания не
загрузились
НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием видео, пожалуйста напишите в поддержку по адресу внизу
страницы.
Спасибо за использование сервиса ClipSaver.ru
🤩 Get the 10 Arduino Programming Tips PDF here: 👇👇 Get the 10 Arduino Programming Tips PDF here: **If you like this, I think you'll like the premium Arduino training we offer. Check it out here** https://bit.ly/3nSBPUs We designed this circuit board for beginners! Kit-On-A-Shield: https://amzn.to/3lfWClU SHOP OUR FAVORITE STUFF! (affiliate links) --------------------------------------------------- We use Rev Captions for our subtitles https://bit.ly/39trLeB Arduino UNO R3: Amazon: https://amzn.to/37eP4ra Newegg: https://bit.ly/3fahas8 Budget Arduino Kits: Amazon:https://amzn.to/3C0VqsH Newegg:https://bit.ly/3j4tISX Multimeter Options: Amazon: https://amzn.to/3rRo3E0 Newegg: https://bit.ly/3rJoekA Helping Hands: Amazon: https://amzn.to/3C8IYXZ Newegg: https://bit.ly/3fb03X1 Soldering Stations: Amazon: https://amzn.to/2VawmP4 Newegg: https://bit.ly/3BZ6oio AFFILIATES & REFERRALS --------------------------------------------------- ►Audible Plus Free trial: https://amzn.to/3j5IGrV ►Join Honey- Save Money https://bit.ly/3xmj7rH ►Download Glasswire for Free:https://bit.ly/3iv1fql FOLLOW US ELSEWHERE --------------------------------------------------- Facebook: / programmingelectronicsacademy Twitter: / progelecacademy Website: https://www.programmingelectronics.com/ Click Below to Read About This Topic on Our Website https://www.programmingelectronics.co... Description: Arduino Course for Absolute Beginners In the last lesson you learned about using the analogRead() function to collect data from a sensor connected to one of the Arduino' analog pins. The range of data we received from the analogRead() function, was mapped from 0 to 1023. What if we wanted to know the actual voltage being applied at the pin? You Will Need Potentiometer (any resistance range will work) Jumper Wires - at least 3 solder-less breadboard Persian Rug Step-by-Step Instructions Place your potentiometer into your breadboard. Run a jumper wire from the 5-Volt pin of the Arduino either one of the outside pins of your potentiometer. Run another jumper wire from one of the ground pins on your Arduino (labeled GND) to the other outside pin of your potentiometer. Run the final jumper wire from pin A0 on your Arduino to the middle pin of the potentiometer. Plug your Arduino into your computer. Open up the Arduino IDE. Go to File, Examples, 01.Basics, ReadAnalogVoltage Click the Verify button on the top left side of the screen. It will turn orange and then back to blue once it has finished. Click the Upload button (next to the Verify button). It will turn orange and then back to blue once it has finished. On the menu bar, go to Tools, Serial Monitor - this will open the Serial Monitor window - you should see numbers rolling down this screen. Now adjust the knob of your potentiometer and watch the serial monitor window, the numbers should adjust between 0 and 5. This sketch does the exact same thing the last lesson covered except for one important change. It takes the reading provided by the analogRead() function and converts it into the actual voltage value at the respective analog pin. Let's start from the top just to review what is taking place... We have no variable to declare and initialize at the beginning of the sketch so we jump right into the setup() function. Inside the curly braces of setup() we begin serial communications by setting the baud rate. This is done using the function Serial.begin(9600). That is all there is to the setup of this sketch. the next block of code is loop(). Inside the curly braces of loop() the first thing we do is read the value at analog pin A0 and assign it to an integer variable called sensorValue. int sensorValue = analogRead(A0); Once we have recorded this value, we now want to convert it to an actual voltage. You will recall that the range returned by the analogRead() function is between 0 and 1023. We want this to reflect the actual voltage at the pin - which is between 0 and 5 volts depending on where we have our potentiometer turned to. So lets take a look at how we might accomplish this... float voltage = sensorValue * (5.0 / 1023.0); The first thing we encounter is a new data type - called float. A float is just a number with a decimal point; say for example 3.14 or 2.17781778. Floats, also called floating point numbers, can be huge in value, and take much more time for the Arduino to churn through than integers - this is why they are avoided unless necessary. We want a float in this case because it will give us more resolution than an integer. So what is that calculation anyway - it looks kind of confusing. The numbers on the right are just a conversion factor. We want to convert one scale to another.