Understanding the schematic diagram - writing a driver
LED Module:
As can be seen from the figure, the LED anode is connected in series with a resistor (which plays a role in current limiting), connected to VCC, and the cathode is connected to port P2. To light up an LED, the corresponding IO needs to be given a low level (because the anode VCC is equivalent to a high level)
To name a pin:
sbit variable name = address value
(For example, sbit led=P2^0 means that the P20 port is named led, and it cannot be written as P2.0)
program:
#include sbit led=P2^0; //The first LED light void main() { while(1) { led=0; //Set led to low level } }
Previous article:4. LED flashing
Next article:2.C51 basic programs and statements
Recommended ReadingLatest update time:2024-11-23 16:09
Recommended posts
- [Fudan Micro FM33LG0 series development board review] Development board microcontroller printf Chinese and English printing test
- ThePINoftheFudanMicroFM33LG0developmentboardspecificationiscovered,somakeanMCUpackageyourself.Inthisway,theFM33LG0pinsareclearataglance. printf()isaformattedoutputfunction,whichisoftenusedtooutputsomeinf
- mameng Domestic Chip Exchange
- Cadence High-Speed PCB Design Practical Strategy
- Thisisabookwrittenbyahigh-speedcircuitdesignanddevelopmentengineerwhohasbeenengagedinthedesignanddevelopmentofawell-knowndesigncompanyintheindustryforalongtime.Thebookintegratestheauthor'sexperience,understand
- arui1999 Download Centre
- A novice needs help. When drawing PCB manual wiring in AD13.4, why can't I see the trace of the wiring before the wiring is completed?
- Anoviceneedshelp.WhendrawingPCBmanualwiringinAD13.4,whycan'tIseethetraceofthewirebeforethewireisdrawn?CanIseethewireonlyafterdrawing?Whatneedstobeset? Notonlythewire(andthearc),itseemsthatallthething
- 121hhhhhh PCB Design
- Limitations of Flash_API for C2000 Series (28335) DSP
- TheAPIcan: 1.RuninstaticinternalSARAM 2.ConfigurethecorrectCPUfrequency 3.IntegratetheAPIintotheapplicationaccordingtotheFlash_APIlist 4.InitializethePLLcontrolregisterandwaitforthePLLtolockbeforeusingtheAP
- fish001 DSP and ARM Processors
- Before using the peripheral modules in STM32, the related clocks must be enabled. Which other modules also need to be enabled?
- InSTM32,therelatedclocksmustbeenabledbeforetheperipheralmodulescanbeused.Inadditiontotheso-calledperipheralmodules,whichothermodulesalsoneedtohavetheirclocksenabledbeforeuse? Opencube,clickclockconfigurati
- 深圳小花 MCU
- Share: Detailed explanation of the 2019 e-sports comprehensive assessment questions
- Thecomprehensiveevaluationofthe2019NationalUndergraduateElectronicDesignCompetitionhasended,andwehaveinvitedXidianUniversitygraduatestudentLiTianhongtogiveusakeyanalysis. Firstlookatthetitle: Remark: 1
- Jacktang Electronics Design Contest
- Naxin Micro and Xinxian jointly launched the NS800RT series of real-time control MCUs
- How to learn embedded systems based on ARM platform
- Summary of jffs2_scan_eraseblock issues
- Application of SPCOMM Control in Serial Communication of Delphi7.0
- Using TComm component to realize serial communication in Delphi environment
- Bar chart code for embedded development practices
- Embedded Development Learning (10)
- Embedded Development Learning (8)
- Embedded Development Learning (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- STMicroelectronics discloses its 2027-2028 financial model and path to achieve its 2030 goals
- 2024 China Automotive Charging and Battery Swapping Ecosystem Conference held in Taiyuan
- State-owned enterprises team up to invest in solid-state battery giant
- The evolution of electronic and electrical architecture is accelerating
- The first! National Automotive Chip Quality Inspection Center established
- BYD releases self-developed automotive chip using 4nm process, with a running score of up to 1.15 million
- GEODNET launches GEO-PULSE, a car GPS navigation device
- Should Chinese car companies develop their own high-computing chips?
- Infineon and Siemens combine embedded automotive software platform with microcontrollers to provide the necessary functions for next-generation SDVs
- Continental launches invisible biometric sensor display to monitor passengers' vital signs
- Siemens Industrial Automation Data Collection (October 18, 2019)
- In gratitude to teachers, FLUKE offers annual discounts! Participate in the event and win a prize of 30,000 yuan!
- Wireless data transmission module
- EEWORLD University Hall----Keithley 4200A-SCS parameter analyzer accelerates semiconductor equipment, materials and process development
- The upcoming Adafruit Feather STM32F405 Express
- Beamforming network based on monopulse system
- How to use the Power Path Selector function of BQ24170 with BQ3050?
- The new version of Unico software for STEVAL-MKI109V3 already supports the LIS25BA bone vibration sensor
- Can an 8-bit microcontroller implement peripheral functions through software?
- BlueNRG video tutorial: BlueNRG-1 ProjectCode