Phone: +86-20-8520 1025       Email: SALES@FRIENDLYARM.COM / techsupport@friendlyarm.com Forum    Wiki

  • Shopping Cart
  • Login
  • Register
  • CPU Module
  • Mini Board
    • Cortex-A9(Quad-Core)
    • Cortex-A8
    • ARM11
    • ARM9
  • NanoPC & NanoPi
  • Hats & Docks
  • Enclosure & Holder
    • 3D Printed
    • Acrylic
    • Metal
    • Plastic
  • Matrix Accessories
    • Actuator
    • Camera
    • Communication
    • Display
    • GPS
    • Heat Sink
    • Power
    • Sensor
    • Serial Comm Board
    • SSD/MicroSD
    • Others
  • BakeBit Sensors/Modules
  • LCD Module
  • Value Pack & Kit
FriendlyElec

Login | Register

  • Home
  • Downloads
  • Forum
  • Wiki
  • Information
    • About Us
    • Privacy Policy
    • Terms & Conditions
  • Distributor
  • FreeBoard
Button BTN-01  Button BTN-01  Button BTN-01  Button BTN-01
Button BTN-01

Button BTN-01

0 reviews / Write a review
  • $99,999.00
  • Availability: Out Of Stock

  • Brand: FriendlyElec
  • Product Code: BTN-01


  • Description
  • Reviews (0)

1 Introduction

The Matrix-Button is an instant(non self-lock) button. The button's status can be read from pin S in the 3-pin 2.54 mm spacing pin header. If the button is not pressed S will output high otherwise S will output low.

2 Features

  • Instant, non self-lock
  • Tiny, easy to be used in various situations
  • 2.54mm spacing pin

3 How To

  • Connect to Tiny4412 SDK (1506)

    Connect the module's pin S to GPIO PIN1, pin V to 5V and pin G grounded

Code Sample in C Under Linux

#include <stdio.h>
#include "libfahw.h"
static struct sensor button[] = {
{
TINY4412_GPIO_PIN1,
IRQ_TYPE_EDGE_FALLING,
}
};
 int main(void)
{
int i;
int retSize = -1;
char value[ARRAY_SIZE(button)];
int devFD = -1;
if ((devFD =sensorInit(button, ARRAY_SIZE(button)
)) == -1) {
printf("Fail to init sensor ");
return -1;
}
printf("Press the button... ");
if (( retSize = sensorRead(devFD, value, ARRAY_SIZE(button)) ) == -1) {
printf("Fail to read sensors ");
}
if (retSize > 0) {
i = 0;
for (i=0; i<retSize; i++) {
printf("Button[%d]:%d ", i, value[i]);
}
}
sensorDeinit(devFD);
return 0;
}


Compile and Run

git clone http://github.com/friendlyarm/fa-hardware.gitcd fa-hardware
cd demo
cd matrix-button
make

Copy your compiled bin to your board and you are ready to go.

Resources


Write a review

Write a review

Note: HTML is not translated!
    Bad           Good


Power & Source of Big Ideas

Follow us
  •  
  •  
  •  
  •  
  •  
  •  
  •  
Newsletter

New in alerts - Sign up to our Newsletter.

Contact Us
  • Room 118,Building A, Shilian Technology Park, No.33 Science Road,Science City,Luogang District, Guangzhou,GuangDong China
  • +86-20-8520 1025
  • sales@friendlyarm.com
  • techsupport@friendlyarm.com
Information
  • About Us
  • Downloads
  • Privacy Policy
  • Terms&Conditions
  • Distributor
  • FreeBoard
Customer Service
  • Contact Us
  • Returns
  • Site Map
My Account
  • My Account
  • Order History
  • Wish List
  • Newsletter


Copyright © 2008-2022 friendlyelec.com All rights reserved.
Top
Categories
  • CPU Module (10)
  • Mini Board (3)
  • NanoPC & NanoPi (29)
  • Hats & Docks (13)
  • Enclosure & Holder (16)
  • BakeBit Sensors/Modules (2)
  • Matrix Accessories (73)
  • LCD Module (16)
  • Value Pack & Kit (11)