test_wiegand.c
Go to the documentation of this file.
00001 #include <stdio.h>
00002 
00003 #include <pigpio.h>
00004 
00005 #include "wiegand.h"
00006 
00007 /*
00008 
00009 REQUIRES
00010 
00011 Wiegand contacts 0 and 1 connected to separate gpios.
00012 
00013 TO BUILD
00014 
00015 gcc -o wiegand_c test_wiegand.c wiegand.c -lpigpio -lrt
00016 
00017 TO RUN
00018 
00019 sudo ./wiegand_c
00020 
00021 */
00022 
00023 void callback(int bits, uint32_t value)
00024 {
00025    printf("bits=%d value=%u\n", bits, value);
00026 }
00027 
00028 int main(int argc, char *argv[])
00029 {
00030    Pi_Wieg_t * w;
00031 
00032    if (gpioInitialise() < 0) return 1;
00033 
00034    w = Pi_Wieg(14, 15, callback, 5);
00035 
00036    sleep(300);
00037 
00038    Pi_Wieg_cancel(w);
00039 
00040    gpioTerminate();
00041 }
00042 


cob_hand_bridge
Author(s): Mathias Lüdtke
autogenerated on Thu Jun 6 2019 20:43:57