Information
Item weight
Barcode
Created time
Last updated on
Item description
IC 74HC165 เป็น IC ขยายขาสัญญาณกรณีต้องการใช้อินพุตจำนวนเยอะโดยใช้อินพุตจากไมโครคอนโทรลเลอร์เพียงแค่ 4 ขา แต่สามารถอ่านสัญญาณ digital ได้ถึง 8 ขา

ตัวอย่างการต่อ Arduino กับ Shift register 74HC165 





ตัวอย่าง Code Arduino กับ Shift register 74HC165 

โหลด Library จาก 
https://github.com/InfectedBytes/ArduinoShiftIn

#include <ShiftIn.h>
// Init ShiftIn instance with one chip.
// The number in brackets defines the number of daisy-chained 74HC165 chips
// So if you are using two chips, you would write: ShiftIn<2> shift;
ShiftIn<1> shift;

void setup() {
 Serial.begin(9600);
 // declare pins: pLoadPin, clockEnablePin, dataPin, clockPin
 shift.begin(8, 9, 11, 12);
}

void displayValues() {
 for (int i = 0; i < shift.getDataWidth(); i++)
   Serial.print( shift.state(i) ); // get state of button i
 Serial.println();
}

void loop() {
 if (shift.update()) // read in all values. returns true if any button has changed
   displayValues();
 delay(1);
}







Shift Register 74HC165
The 74HC165 is an 8-bit serial-in shift register. It uses only 4 Arduino pins, while itself can read in from 8 digital pins. If the parallel load pin (PL) is LOW, the data is read from the A to H pins in parallel. When PL is HIGH, the Q pin is set to the value of the first bit. Each time you change the value from your clock pin from LOW to HIGH, the next bit is send to the Q pin. Therefore you can read in all 8 bits sequentially. Furthermore you can daisy-chain several shift registers, while still using only 4 Arduino pins!
The data sheet can be found here: SN74HC165
 
ShiftIn Library
In order to simplify the usage of shift registers, I wrote a small library that handles the communication between the Arduino and the shift register. It is hosted on Github.
Conditions
Tags

Exchange or return policy



Every item comes with a 30-day warranty. However, there are certain conditions that apply:

  1. The customer should not be responsible for any self-inflicted damage, such as incorrect power connections (for example, supplying 5V instead of the required 3.3V for a sensor).

  2. The product must be in perfect condition, without any breakage or damage caused by electricity (e.g., short circuits leading to electrical fires).

  3. The store does not accept product exchanges due to customer misunderstandings, such as purchasing the wrong size for their project or buying something without eventually using it. Customers can inquire about the product details and ensure compatibility before making a purchase by contacting us through our Line account @modulemore during business hours. Please note that there may be delays in response between 12:00 PM and 2:00 PM.

Return Policy: To initiate a product return, customers must provide the original receipt or a copy for quick verification. Returns can be sent to our store address by following these guidelines:

  1. Provide a detailed description of the damaged item(s).
  2. Mention any tests or experiments conducted by the customer.

Please note that the store reserves the right to make the final decision regarding product replacement or refund.

English

Categories

TRACK & TRACE

*Enter your order ID or email used in placing an order

OVERVIEW

Pageviews2,072,905 view(s)
Visitors1,333,631 time(s)
Last updatedSep 7, 2025

JOIN US

ร้านModuleMore
ร้านModuleMore
/www.modulemore.com/en
Join as a Member
600
Become a member of this store to receive special offers and promotions
Choose your language
Language
Currency
Change
Modify language
My orders
This seller's information
ร้านModuleMore
ModuleMore
Arduino compatible board, Iot, ESP32, ESP8266, Nodemcu, Raspberry pi, micro:bit and etc.
Mobile number : 0831710868
E-mail : paheyisoicus@gmail.com
Send message to seller
About this seller
Recently viewed items
Favourite this seller
Join as a Member
Share this page
Share this page

TOP Back to top
Contact me