Page 1 of 2

Need help in programming

PostPosted: Thu Mar 29, 2012 9:03 am
by Suria
#define ACK_SUCCESS 0x00 //Module reply success
#define ACK_FAIL 0X01 //Module reply fail
#define ACK_NOUSER 0x05 //Module reply no user
#define ACK_USER_EXIST 0x07 //Module reply user exist
#define ACK_TIMEOUT 0x08 //Module reply timeout
#define ACK_ACCESS 0x03 //Module reply access allowed


what does this code mean? help :( school project due in 3 days~~

Re: Need help in programming

PostPosted: Thu Mar 29, 2012 9:23 am
by Suria
//configure reader setting
send_cmd(0x2E,0x00,0x10,0x00);//configure Time out(0x10 means timeout after approx. 7s)
delay(10);
receive_reply_nodisplay(); //get reply from UART but do not display
send_cmd(0x2d,0x00,1,0x00); //send command to configure not allowed repeat
delay(10);
receive_reply_nodisplay(); //get reply from UART but do not display

and this one tooo..

Re: Need help in programming

PostPosted: Thu Mar 29, 2012 10:37 am
by Idris
This program for what project?

Re: Need help in programming

PostPosted: Thu Mar 29, 2012 11:17 am
by Suria
PR29 :D :)

Re: Need help in programming

PostPosted: Thu Mar 29, 2012 1:34 pm
by ABSF
Suria WROTE:#define ACK_SUCCESS 0x00 //Module reply success
#define ACK_FAIL 0X01 //Module reply fail
#define ACK_NOUSER 0x05 //Module reply no user
#define ACK_USER_EXIST 0x07 //Module reply user exist
#define ACK_TIMEOUT 0x08 //Module reply timeout
#define ACK_ACCESS 0x03 //Module reply access allowed


what does this code mean? help :( school project due in 3 days~~


6 states of the variable call ACK?

Allen

Re: Need help in programming

PostPosted: Thu Mar 29, 2012 2:30 pm
by Idris
Don't know to explain, there already have a comment at the program line. huhu. :?

CODE: SELECT_ALL_CODE
#define ACK_SUCCESS 0x00 //Module reply success
#define ACK_FAIL 0X01 //Module reply fail
#define ACK_NOUSER 0x05 //Module reply no user
#define ACK_USER_EXIST 0x07 //Module reply user exist
#define ACK_TIMEOUT 0x08 //Module reply timeout
#define ACK_ACCESS 0x03 //Module reply access allowed


CODE: SELECT_ALL_CODE
//configure reader setting
send_cmd(0x2E,0x00,0x10,0x00);//configure Time out(0x10 means timeout after approx. 7s)
delay(10);
receive_reply_nodisplay(); //get reply from UART but do not display
send_cmd(0x2d,0x00,1,0x00); //send command to configure not allowed repeat
delay(10);
receive_reply_nodisplay(); //get reply from UART but do not display

Re: Need help in programming

PostPosted: Thu Mar 29, 2012 2:52 pm
by shahrul
CODE: SELECT_ALL_CODE
#define ACK_SUCCESS 0x00

define is like we rename or declare something.

CODE: SELECT_ALL_CODE
send_cmd(0x2d,0x00,1,0x00);

This is function to send UART to the Fingerprint Reader. The protocol, you need to refer inside this function and open the manual.

I also have sample code Fingerprint Reader. It's only the function is different.
Cytron use:
CODE: SELECT_ALL_CODE
send_cmd(0x2D,0x00,0x01,0x00);

I use:
CODE: SELECT_ALL_CODE
uart_transmit(0xF5);
uart_transmit(0x2D);
uart_transmit(0x00);
uart_transmit(0x01);
uart_transmit(0x00);
uart_transmit(0x00);
uart_transmit(0x2D^0x00^0x01^0x00^0x00);
uart_transmit(0xF5);

#Sorry, my English Language explanation not very good, my C Language better. :D

Re: Need help in programming

PostPosted: Thu Mar 29, 2012 3:29 pm
by Suria
thanks shahrul, it's okay. u're malay? :D

out of the topic question, if you become one of the assessor in our school, what would u ask regarding programming? :? i'm very nervous for the presentation. :cry:

Re: Need help in programming

PostPosted: Thu Mar 29, 2012 3:45 pm
by shahrul
Suria WROTE:thanks shahrul, it's okay. u're malay? :D

out of the topic question, if you become one of the assessor in our school, what would u ask regarding programming? :? i'm very nervous for the presentation. :cry:

Yes, I'm malay.
I'm google translate 'assessor', owh that. :D
If I'm assessor, I ask what microcontroller module you use, ex ADC, PWM, EEPROM, Interrupt, Timer, UART, SPI, I2C. Then asking what ever have in the source code..

Re: Need help in programming

PostPosted: Thu Mar 29, 2012 4:11 pm
by Suria
PIC16F876A is an EEPROM right? ahhaha :D

don't worry, saya org melayu :D