Need help in programming

LED Blinking, Walking with Cytron Servo, Displaying RFID, Multi-function Mobile Robot......

Need help in programming

Postby Suria » Thu Mar 29, 2012 9:03 am

#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~~
Suria
Novice
 
Posts: 24
Joined: Sat Dec 31, 2011 11:21 am

Re: Need help in programming

Postby Suria » Thu Mar 29, 2012 9:23 am

//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..
Suria
Novice
 
Posts: 24
Joined: Sat Dec 31, 2011 11:21 am

Re: Need help in programming

Postby Idris » Thu Mar 29, 2012 10:37 am

This program for what project?
Cytron Technologies invest time and resources providing tutorial, training and support for STEM education and maker movement. We need your support by purchasing products from Cytron Technologies. Thanks.
http://www.cytron.com.my
User avatar
Idris
Moderator
 
Posts: 379
Joined: Thu Mar 22, 2012 5:28 pm
Location: Pulau Pinang

Re: Need help in programming

Postby Suria » Thu Mar 29, 2012 11:17 am

PR29 :D :)
Suria
Novice
 
Posts: 24
Joined: Sat Dec 31, 2011 11:21 am

Re: Need help in programming

Postby ABSF » Thu Mar 29, 2012 1:34 pm

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
The next war will determine NOT who is right BUT what is left.
User avatar
ABSF
Professional
 
Posts: 810
Joined: Wed Nov 10, 2010 9:32 am
Location: E Malaysia

Re: Need help in programming

Postby Idris » Thu Mar 29, 2012 2:30 pm

Don't know to explain, there already have a comment at the program line. huhu. :?

Code: Select all
#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
//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
Cytron Technologies invest time and resources providing tutorial, training and support for STEM education and maker movement. We need your support by purchasing products from Cytron Technologies. Thanks.
http://www.cytron.com.my
User avatar
Idris
Moderator
 
Posts: 379
Joined: Thu Mar 22, 2012 5:28 pm
Location: Pulau Pinang

Re: Need help in programming

Postby shahrul » Thu Mar 29, 2012 2:52 pm

Code: Select all
#define ACK_SUCCESS 0x00

define is like we rename or declare something.

Code: Select all
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
send_cmd(0x2D,0x00,0x01,0x00);

I use:
Code: Select all
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
User avatar
shahrul
Professional
 
Posts: 812
Joined: Sat May 16, 2009 9:54 pm
Location: Selangor

Re: Need help in programming

Postby Suria » Thu Mar 29, 2012 3:29 pm

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:
Suria
Novice
 
Posts: 24
Joined: Sat Dec 31, 2011 11:21 am

Re: Need help in programming

Postby shahrul » Thu Mar 29, 2012 3:45 pm

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..
User avatar
shahrul
Professional
 
Posts: 812
Joined: Sat May 16, 2009 9:54 pm
Location: Selangor

Re: Need help in programming

Postby Suria » Thu Mar 29, 2012 4:11 pm

PIC16F876A is an EEPROM right? ahhaha :D

don't worry, saya org melayu :D
Suria
Novice
 
Posts: 24
Joined: Sat Dec 31, 2011 11:21 am

Next

Return to DIY Project Set

Who is online

Users browsing this forum: No registered users and 3 guests

cron