¥Û¡¼¥à > Arduino ¥»¥ó¥µ > Grove 125kHz RFID¥ê¡¼¥À_SeeedsStudio
Grove 125kHz RFID¥ê¡¼¥À_SeeedsStudio
1,540±ß(ÀÇ140±ß)
Grove 125kHz RFID¥ê¡¼¥À¤Ï¡¢uem4100 RFID¥«¡¼¥É¾ðÊó¤òÆɤ߹þ¤à¤¿¤á¤Î¥â¥¸¥å¡¼¥ë¤Ç¤¹¡£Uart¤ÈWiegand¤Î2¤Ä¤Î¥¢¥¦¥È¥×¥Ã¥È¥Õ¥©¡¼¥Þ¥Ã¥È¤¬¤¢¤ê¤Þ¤¹¡£¸¡½Ðµ÷Î¥¤ÏºÇÂç7ѤǤ¹¡£ ¡ãGrove 125kHz RFID¥ê¡¼¥À¤Î¼ç¤ÊÆÃħ¡ä ¡¦Uart¤ÈWiegand¤Î2¤Ä¤Î¥¢¥¦¥È¥×¥Ã¥È¥Õ¥©¡¼¥Þ¥Ã¥È¤¬ÁªÂò²Äǽ ¡¦£´Pin Grove¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹ ¡¦¹â´¶ÅÙ RFID¥ê¡¼¥À ¡¦ ¡ãGrove 125kHz RFID¥ê¡¼¥À¤Î»ÈÍÑÍÑÅÓ¡ä ¡¦¥â¥Î¤Î¥¤¥ó¥¿¡¼¥Í¥Ã¥È Internet of Thing ¡¦¥Ú¥Ã¥È¤ª¤â¤Á¤ã ¡¦Æþ¸ý¤Î¥³¥ó¥È¥í¡¼¥ë¥·¥¹¥Æ¥à Grove 125kHz RFID¥ê¡¼¥À¤Ë¤Ä¤¤¤Æ¤ÎÄɲþðÊ󡦾ܺپðÊó¤Ï²¼µ¥Ú¡¼¥¸(±Ñ¸ì)¤ò¤´Í÷¤¯¤À¤µ¤¤¡£ http://www.seeedstudio.com/wiki/Grove_-_125KHz_RFID_Reader ¡ãGrove 125kHz RFID¥ê¡¼¥À¤Î¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à¡ä /*Uarts¥â¡¼¥É¤Ç¤Î»ÈÍѤǤ¹¡£U¤Î²Õ½ê¤Ë¥¸¥ã¥ó¥Ñ¤ò¤«¤±¤Æ¤¯¤À¤µ¤¤¡£Grove¥Ù¡¼¥¹¥·¡¼¥ë¥É¤ò»ÈÍѤ·¡¢Grove 125kHz RFID¥ê¡¼¥À¤òUART¥Ô¥ó¤ËÀܳ¤·¤Þ¤¹¡£ÀßÄê¤Ï¡¢9600bps,N,8,1,TTL½ÐÎϤˤ·¤Þ¤¹¡£¥·¥ê¥¢¥ë¥â¥Ë¥¿¤Ç¥«¡¼¥É¾ðÊó¤ò³Îǧ¤¹¤ë¤³¤È¤¬½ÐÍè¤Þ¤¹¡£*/ #include <SoftwareSerial.h> SoftwareSerial SoftSerial(2, 3); unsigned char buffer[64]; // buffer array for data recieve over serial port int count=0; // counter for buffer array void setup() { SoftSerial.begin(9600); // the SoftSerial baud rate Serial.begin(9600); // the Serial port of Arduino baud rate. } void loop() { if (SoftSerial.available()) // if date is comming from softwareserial port ==> data is comming from SoftSerial shield { while(SoftSerial.available()) // reading data into char array { buffer[count++]=SoftSerial.read(); // writing data into array if(count == 64)break; } Serial.write(buffer,count); // if no data transmission ends, write buffer to hardware serial port clearBufferArray(); // call clearBufferArray function to clear the storaged data from the array count = 0; // set counter of while loop to zero } if (Serial.available()) // if data is available on hardwareserial port ==> data is comming from PC or notebook SoftSerial.write(Serial.read()); // write it to the SoftSerial shield } void clearBufferArray() // function to clear buffer array { for (int i=0; i { buffer[i]=NULL;} // clear all index of array with command NULL }