I'm trying to communicate with a fingerprint module
i need to send the following packets of data for a single command.
0x4D + 0x2A + 0x10
Now how do i actually send these using the arduino serial print function.
When i try to serial print with various options (HEX,etc) and monitor it using serial monitor i dont see these values getting printed in the serial monitor
I would appreciate if someone can give me a sample code of how to communicate such data. I assume th '+' between the bytes means that i transmit byte after byte?
heres the user manual for the module i'm using.http://www.4shared.com/file/80936462/78868372/_2__SM-630_USER_MANUAL.html
I actually already told you how to do this in your first topic (http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1232117916/3#3
But, to reiterate, you need to use serial.print(0xVALUE, BYTE);
Also, don't use println use just print.
To send the byte sequence above to the fingerprint unit you would do this:
In general, though, it's best to make #DEFINEs for each hex code so that things are more clear. For instance, let's say that 0x4D is always a start code and 0x2A means validate fingerprint. 0x10 could maybe mean only accept an administrator's print. So the defines might be:
#DEFINE StartByte 0x4D
#DEFINE CapturePrint 0x2A
#DEFINE Accept_Admin 0x10
And then the above serial output would instead be:
This is more clear for when you read the code in the future. It's a lot easier to figure out what is going on.