Click here to Skip to main content
15,995,388 members

Comments by Member 10252237 (Top 3 by date)

Member 10252237 4-Nov-14 6:52am View    
solved, here is source code

// ****************************************
//
// File: em4102.biometric.1v1.twn.c
// Date: 2014/11/03
// Version: 1.00
// Mod: AA
//
// ****************************************

#include <sys.twn.h>

const byte MAXIDBYTES = 8;
const byte MAXIDBITS = MAXIDBYTES*8;

byte ID[MAXIDBYTES];
byte IDBitCnt;
byte TagType;

byte LastID[MAXIDBYTES];
byte LastIDBitCnt;
byte LastTagType;

void main()
{
// Make some noise at startup at minimum volume
Beep(BEEPSUCCESS);
// Set maximum volume
SetVolume(4);
// A V24 device is sending the version at startup
if (GetConnection() == V24)
{
HostSendVersion();
HostSendChar('\r');
}
// Turn on green LED
LEDSet(GREEN,ON);
// Turn off red LED
LEDSet(RED,OFF);
// No transponder found up to now
LastTagType = TAGTYPE_NONE;
while (TRUE)
{
// Search a transponder
if (TagSearch(ID,IDBitCnt,TagType))
{
if (TagType == TAGTYPE_EM4102)
{
// Is this transponder new to us?
if (TagType != LastTagType || IDBitCnt != LastIDBitCnt || !CompBits(ID,LastID,MAXIDBITS))
{
// Save this as known ID, before modifying the ID for proper output format
CopyBits(LastID,0,ID,0,MAXIDBITS);
LastIDBitCnt = IDBitCnt;
LastTagType = TagType;

// Yes! Sound a beep
Beep(BEEPHIGH);
// Turn off the green LED
LEDSet(GREEN,OFF);
// Let the red one blink
LEDSet(RED,BLINK);
// Send last 3 bytes
HostSendHex(ID[2],3*8,3*2);
HostSendChar('\r');
}
// Start a timeout of two seconds
StartTimer(0,20);
}
}
if (TestTimer(0))
{
LEDSet(GREEN,ON);
LEDSet(RED,OFF);
LastTagType = TAGTYPE_NONE;
}
}
}
Member 10252237 1-Nov-14 11:20am View    
sorry i didnt explain exactly, i can but dont know how.....
Member 10252237 1-Nov-14 5:45am View    
yes of course need to cut of the first four, problem is that script is not created by me, it is script of manufacturer and i cant modify it for achieve it.... it is reason why i posted here, maybe wil be somebody succesfull.