Go to the documentation of this file.00001 #include <iostream>
00002
00003 #include <pigpio.h>
00004
00005 #include "wiegand.hpp"
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 void callback(int bits, uint32_t value)
00024 {
00025 std::cout << "bits=" << bits << " value=" << value << std::endl;
00026 }
00027
00028 int main(int argc, char *argv[])
00029 {
00030 if (gpioInitialise() < 0) return 1;
00031
00032 Wiegand dec(14, 15, callback);
00033
00034 sleep(300);
00035
00036 dec.cancel();
00037
00038 gpioTerminate();
00039 }
00040