在Rasberry上通过C ++启动模块pn532

时间:2017-01-13 08:22:36

标签: c++ raspberry-pi

我想开始 pn532

int USB = open( "/dev/ttyUSB2", O_RDWR| O_NOCTTY );
...
char cmd[] = {0x55, 0x55, 0, 0, 0};
do {
n_written = write( USB, &cmd[spot], 1 );
spot += n_written;
} while (cmd[spot-1] != '\r' && n_written > 0);

但它不起作用。我的错误在哪里?

0 个答案:

没有答案