Show Posts
|
|
Pages: [1]
|
|
2
|
Using Arduino / Programming Questions / Programing question
|
on: January 15, 2013, 12:56:23 pm
|
|
Hello, I’m trying to figure out a few things with Arduino hooked up to Parallax reader but got stuck on some code. Tried to look at Arduino help/reference doesn’t give me much hope. I guess this is completely beginner inexperience not to say lack of knowledge and if anyone can spare a few minutes to clarify that for me, I would be grateful. What is the difference between the following variable declarations:
First question:
--------------------------------------- String keyCode; String accessList[NumberOfKeys]; char code[10]; -------------------------------------- I can see two arrays have been allocated but what is basically confusing me is string and char. What is the difference between them?
Second question: ------------------------------------- keyCode = code; keyCode = keyCode.substring(0,10); ------------------------------------- What is happening here, keyCode variable has been assigned code value, why we need the next line of code with keyCode.substring(0,10)?
Thank you very much in advance, Tom
|
|
|
|
|
3
|
Community / Exhibition / Gallery / Re: PRFID Mod Parallax RFID reader
|
on: January 13, 2013, 05:20:02 am
|
|
Hello,
Pretty interesting topic and since I am a complete beginner in programming, got stuck understanding your code as follows:
1. Why this line is necessary, some kind of data conversion? keyCode = keyCode.substring(0,10);
2. What will happen here, if the first if statement is correct, the code will execute and else statement will be skipped, am I right? Actually what is the purpose of the first statement.
if((keyCode == Master) && (programmingMode == false)) {programmingMode = true; digitalWrite(PROGRAMMING_LIGHT,HIGH); } else {if(programmingMode == false)
Thanks in advace, Tom
|
|
|
|
|