好!我有一个电路,其中我将 Arduino 连接到 NFC Shield,它是一个协议板。我的目标是激活一个适用于 10-24V AC 和 DC 的电锁,为此我放置了一个晶体管 2N2222 和 330 欧姆的电阻。当我将板协议板连接到锁上时,我遇到的问题是,LED 打开,但锁是不可移动的。
这是我自己组装所有东西的计划。
这是我如何武装的图像:
最后我有我使用的代码:
#include <PN532.h>
#include <SPI.h>
/*Chip select pin can be connected to D10 or D9 which is hareware optional*/
/*if you the version of NFC Shield from SeeedStudio is v2.0.*/
#define PN532_CS 10
PN532 nfc(PN532_CS);
#define NFC_DEMO_DEBUG 1
const int control = 7 ;
const int speed = 200;
void setup(void) {
pinMode(control, OUTPUT) ;}
void loop(void) {
digitalWrite(control, HIGH);
delay(2000);
digitalWrite(control, LOW);
delay(1000);
}
本站系公益性非盈利分享网址,本文来自用户投稿,不代表码文网立场,如若转载,请注明出处
评论列表(36条)