arduino - 为什么我的指纹传感器不响应我的 arduino 代码?

标签 arduino fingerprint

我买了一个 GT-511C1R 指纹扫描仪,与我的 Arduino Mega 结合使用。我用了这个例子:http://www.homautomation.org/2014/10/11/playing-with-finger-print-scanner-fps-on-arduino/

但是当我尝试使用库附带的默认代码使 LED 闪烁时

#include "FPS_GT511C3.h"
#include "SoftwareSerial.h"

// Hardware setup - FPS connected to:
//    digital pin 4(arduino rx, fps tx)
//    digital pin 5(arduino tx - 560ohm resistor fps tx - 1000ohm resistor - ground)
//      this brings the 5v tx line down to about 3.2v so we dont fry our fps

FPS_GT511C3 fps(4, 5);

void setup()
{
    Serial.begin(9600);
    fps.UseSerialDebug = true; // so you can see the messages in the serial debug screen
    fps.Open();
}


void loop()
{
    // FPS Blink LED Test
    fps.SetLED(true); // turn on the LED inside the fps
    delay(1000);
    fps.SetLED(false);// turn off the LED inside the fps
    delay(1000);
}

它什么都不做。在我的串行监视器上,我得到:

FPS - Open
FPS - SEND: "55 AA 01 00 00 00 00 00 01 00 01 01"

但指纹扫描仪的 LED 保持关闭状态。结合我的 Arduino Uno,它确实有效。可能是什么问题?

编辑:在更换引脚后,它仅通过引脚 10 和 11 工作了 1 次。断开电源后,它不再工作了。也不在其他引脚上。

最佳答案

并非所有引脚都支持 Mega 上的 SoftwareSerial; RX 引脚必须是电平变化中断引脚。此类引脚列表:

10, 11, 12, 13, 50, 51, 52, 53, 62, 63, 64, 65, 66, 67, 68, 69

基本上,将对象中的引脚更改为 10 和 11。我建议使用硬件串行端口,Mega 拥有丰富的硬件串行端口,但从我的简短阅读来看,您的库似乎很难使用 SoftwareSerial 并且不太容易适应。

关于arduino - 为什么我的指纹传感器不响应我的 arduino 代码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38490477/

相关文章:

c++ - 多个文件中的多个类 - C++/Arduino

c - 是否可以在 Arduino 平台上扫描所有可用的 SSID?

c++ - 在 Arduino ESP8266 上加载配置参数

arduino - SML 需要 C++14 支持

android - 如何通过 USB 将 SecuGen 指纹扫描仪集成到 Android 应用程序中

bitmap - 将指纹位图转换为 ISO/IEC 19794-2 模板

android - 检测指纹传感器上的手势-Android

c++ - 从C中的字符串中剪切字符

iphone - 在 JavaScript 中检测 iPhone Xr 和 iPhone Xs

c++ - 打开 3D 指纹(转换为 2D)