- Programming the BeagleBone
- Yogesh Chavan
- 397字
- 2021-07-23 14:36:46
Digital I/O
In real life, there are many things that can have only two possible states, for example, a book is either open or closed, your smartphone screen can be locked or unlocked, power switches at home can be on or off. This holds true for some input and output components attached to BeagleBone as well. For example, LEDs can be either on or off, a push button can be in a pushed state or normal state (often referred to as a closed or open state). These components with only two possible states are digital components.
If you look at the nearby area of the BeagleBone processor AM335X chip carefully, you will see that many physical lines are connecting the processor to various other chips or components on the board. Each of these lines connects to the processor at a point called Ball or Pin. The BeagleBone processor has several such pins to communicate with outside chips and components. Among these pins, some pins are dedicated to deal with digital components only. We cannot attach analog components to these pins. These pins are called digital I/O pins. You can write either a HIGH or LOW state on the digital output pin through software. When you write HIGH, the pin gets positive voltage, and when you write LOW, the pin gets zero voltage from the processor. You can read the state of digital input pins as HIGH or LOW according to the voltage set by the component connected to this pin. Onboard LEDs and buttons of BeagleBone are connected to digital I/O pins of the processor. So if we write a HIGH state on the digital output pin connected to an onboard LED, that LED will glow.
Digital electronics works at two logic levels—HIGH (Binary 1) or LOW (Binary 0). Different boards follow different voltage ranges to represent HIGH and LOW. BeagleBone works on a 3.3 voltage level. If we program a digital pin as HIGH on BeagleBone, 3.3 volts is set on this pin. So, whatever digital component is attached to this pin, say, an LED, gets 3.3 volts and the current flows through it turning it on. As a programmer, you need not know about the voltage and current flowing from digital components if they are compatible with the 3.3V logic. Let's see the functions that we will use in our LED blinking program.
- Microsoft Application Virtualization Cookbook
- 算法訓(xùn)練營(yíng):提高篇(全彩版)
- The DevOps 2.5 Toolkit
- Java實(shí)戰(zhàn)(第2版)
- 區(qū)塊鏈技術(shù)進(jìn)階與實(shí)戰(zhàn)(第2版)
- App Inventor創(chuàng)意趣味編程進(jìn)階
- Android傳感器開(kāi)發(fā)與智能設(shè)備案例實(shí)戰(zhàn)
- Building Serverless Web Applications
- Go語(yǔ)言底層原理剖析
- C++從入門(mén)到精通(第6版)
- JavaScript悟道
- Docker:容器與容器云(第2版)
- Isomorphic Go
- SQL Server 2014 Development Essentials
- Getting Started with the Lazarus IDE