29 lines
508 B
C
29 lines
508 B
C
#include <stdio.h>
|
|
|
|
#include "barcode.h"
|
|
|
|
int main()
|
|
{
|
|
if (barcode_initialize("/dev/ttyUSB0"))
|
|
{
|
|
printf("Could not initialize barcode.\n");
|
|
return 1;
|
|
}
|
|
|
|
char Barcode[14];
|
|
if (barcode_read(Barcode))
|
|
{
|
|
printf("Could not read barcode.\n");
|
|
return 1;
|
|
}
|
|
printf("barcode: %s\n", Barcode);
|
|
if (barcode_read(Barcode))
|
|
{
|
|
printf("Could not read barcode.\n");
|
|
return 1;
|
|
}
|
|
printf("barcode: %s\n", Barcode);
|
|
|
|
return 0;
|
|
}
|