Let's see... what else...
I think there's also an assumption here that the reader will understand that the Serial.available command is not going to start until the Enter button is pressed and sending your RGB values but that's not expressly stated.
There's also no explanation of why the numChar is limited to 15 characters. I'm guessing that spaces are ignored, because in the example "R255, G255, B255" (including the ending NULL), if I count the spaces, I'm getting 17 characters just as the author states... but if it gets cut to 15, that means the last 2 characters get deleted, right? If not the NULL, then at least the '55' at the end of the 'B255' - I may need someone to explain this a bit better.
Page 73 - the author explains the * as designating a pointer, but he states it's been added to the variable name as '*data' - but the code in the book and the code I actually ran has the * added to the char data type - char* - any ideas why? Simply a typo?
The rest of the code, especially parsing the RGB code you type in and having it checked and then routed to the right LED - got it. Not a problem.
Overall, I like the power that Project 10 demonstrates (controlling things via a keyboard) but much of the code is still confusing to me... and I imagine it will be to a lot of readers. I certainly don't have time to dive deep into the C/C+ programming language right now, so I'll just accept that not everything makes sense right now and take what I can and move on...
No comments:
Post a Comment