This website uses cookies
This website uses cookies. For further information on how we use cookies you can read our Privacy and Cookie notice
This website uses cookies. For further information on how we use cookies you can read our Privacy and Cookie notice
In stock
Shipped from abroad
Free return within 15 days for all eligible items.Details
mo338
46%Seller Score
12 Followers
Shipping speed: Good
Quality Score: Very Poor
Customer Rating: Average
Product Name:Tb371 2pcs 4 Mcu Key on Switch Matrix Is Suitable For 2560 Due Raspberry Pi Banana Pi Breadboard Fpga Cpld St2
Packing list(Does not include R3):2 PCS 4 key push on switch;Descrtion:
Can be inserted directly into Arduiuo 2560 due,Ideal for linking up to your Arduiuo Mini Nano 2560 Breadboard raspberry pi banana pi etc,or others MCU PLD CPU ( A ST2 ARM C51 NRF24LE1 CC2530 MSP430 STM8 FPGA CPLD etc.)
1 4-on Common Cathode key module(When preed output low level).
2 '' GND K1 K2 K3 K4'' 4 PIN OUT 2.54mm
3 Working voltage: DC 0-48 Size: 12.7MM x 33MM.
Arduiuo /2560 Code/******************************************************//*Arduiuo_4key_uartThis example code is in the public domain.*// Define key pinint K1 = 13;int K2 = 12;int K3 = 11;int K4 = 10;/ variables will change:int onState = 0; / variable for reading the pushon status/ the setup routine runs once when you pre reset:void setup() {/ initialize the keys pin as an input.pinMode(K1, INPUT);pinMode(K2, INPUT);pinMode(K3, INPUT);pinMode(K4, INPUT);/Activate key pin internal pull-up sdialWrite(K1, HIGH);dialWrite(K2, HIGH);dialWrite(K3, HIGH);dialWrite(K4, HIGH);/ initialize serial communications at 9600 bps:Serial.begin(9600);}/ the loop routine runs over and over again :void loop() {onState = dialRead(K1);if(!onState)Serial.print(''k1 /n'' );do{onState = dialRead(K1);}while(!onState);/Wait on releaseonState = dialRead(K2);if(!onState)Serial.print(''k2 /n'' );do{onState = dialRead(K2);}while(!onState);/Wait on releaseonState = dialRead(K3);if(!onState)Serial.print(''k3 /n'' );do{onState = dialRead(K3);}while(!onState);/Wait on releaseonState = dialRead(K4);if(!onState)Serial.print(''k4 /n'' );do{onState = dialRead(K4);}while(!onState);/Wait on releasedelay(100);}/******************************************************/Circuit schematics :
This product has no ratings yet.
Subscribe to our newsletter
and be the first one to know about our amazing deals!