Seventh chapter LED will blink for us: control Light Emitting diode

Source: Internet
Author: User

Seventh Chapter LED will blink for us: Control Light Emitting diode

How LEDs work: Light emitting diodes It is a kind of semiconductor diode that can convert electrical energy into solar energy.;often abbreviated toLED. LEDs, like ordinary diodes, are made up of aPNand a unidirectional conductivity. When a forward voltage is added to the light emitting diode, theParea injected intoNarea of the hole and byNarea injected intoParea of electronics, inPNwithin a few microns near the junction, respectivelyNarea of electronic andPThe cavity of the zone is compounded to produce the fluorescence of spontaneous emission. The energy state of electrons and holes in different semiconductor materials is different. When electrons and holes are combined, the amount of energy released is different, and the more energy is released, the shorter the wavelength of light emitted. Commonly used is a red, green or yellow light diode.

LED Driver Implementation principle: TheLinux Drive and hardware to interact with the current I/o memory interaction,I/o Memory is through a variety of interfaces (PCI,USB, Bluetooth, Ethernet interface, etc.) connected to (PC, mobile) hardware (network card, Camera, etc.) on the host and then perform hardware interaction.

WriteLEDDrive: CreateLEDDrive the device file:1.UseCdev_initInitialization of functionsCdev;2.specify the device number;3.UseCdev_addfunction to add a character device to the kernel's character device array;4.Usestruct_createMacro CreationStruct_class;5.Usedevice_createfunction to create a device file. And then it's uninstall .LEDdrive the device file, then set the register and initialize theLEDDrive, Final controlLED.

Test led driver: First write the generic program for the test I/O control command, then the NDK test led driver, take the Java Code test and use the two code file paths in these steps.

LED driver Transplant: After the successful transplant can be perfect control LED4 a small light off!

Seventh chapter LED will blink for us: control Light Emitting diode

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.