Mbed platform I/O

Source: Internet
Author: User

It's nothing more than digital Io and analog Io

Digital Io
  • Digitalout-configure and control a digital output pin.
  • Digitalin-configure and control a digital input pin.
  • Digitalinout-bi-directional digital pins

Each page on the mbed website has a hardware diagram to show you the pin name. The blue labels can be used as digital Io.

If digitalout is used, 0 is off, and 1 is on;

In digitalin, input lower than 0.8v is considered as 0, input higher than 2.0v is considered as 1.

Digitalinout is the sum of the two above.

  • Busin-flexible way to read multiple digitalin pins as one value
  • Busout-flexible way to write multiple digitalout pins as one value
  • Businout-flexible way to read/write multiple digitalinout pins as one value

Bus is a very interesting thing.

Using bus, you can read a string of digital Io ports at the same time, and their statuses are saved as a binary number. For more information, see the above link.

  • Portin-fast way to read multiple digitalin pins as one value
  • Portout-fast way to write multiple digitalout pins as one value
  • Portinout-fast way to read/write multiple digitalinout pins as one value

Port is to read the data of gpio in the same port at the same time. Faster than bus. For more information, see the above link.

The port name is in portnames. h.

  • Pwmout-pulse-width modulated output

PWM output, very useful.

First, check whether the interface supports PWM output in the hardware diagram. Second, different pin may be connected to a timer. If they all use the PWM mode, their output will be the same.

You can set the period, pulse width, and duty cycle of PWM. For more information, see the above link.

Analog Io

You can specify the analog Io pin on the hardware diagram.

The read and output ranges from 0.0 ~ 3.3 V.

The common read () reads 0.0 ~ 1.0. Read from 0x0 ~ 0xffff.

Mbed platform I/O

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.