ARDUINO101 Study Notes (vi)--Advanced IO

Source: Internet
Author: User

1. Displacement output function (8-bit)

When the value data is entered, the Arduino automatically assigns the data movement to 8 parallel outputs. Where Datapin is the pin number of the connection DS, Clockpin is the pin number of the connection SH_CP, the Bitorder is to set the data displacement order, respectively, high-first-entry msbfirst or low-first-in Lsbfirst.

//*********************************************************************************************//function name: void Shiftout (uint8_t datapin, uint8_t clockpin, uint8_t Bitorder, byte val)//input parameters: PIN data pin//Clock Clocks//Bitorder shift sequence Msbfirst or Lsbfirst//Val Data//function return: none//function Function: Displacement output function//*********************************************************************************************voidShiftout (uint8_t datapin, uint8_t clockpin, uint8_t Bitorder,byteVal);

2. Read Pulse

The pulse of the read pin, the pulse can be high or low, if it is higher, the function is first set to the highest level, and then the timing, wait until the low level, the length of the pulse returned, in milliseconds, if the timeout has not read to the lower level, return 0.

//*********************************************************************************************//function Name: unsigned long Pulsein (uint8_t pin, uint8_t state, unsigned long timeout)//input parameters: Pin PIN number//State Pulse Status//Timeout time-out//function return: Duration//function function: Read pulse//*********************************************************************************************UnsignedLongPulsein (uint8_t pin, uint8_t state, unsignedLongTimeout);

ARDUINO101 Study Notes (vi)--Advanced IO

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.