I'm sorry, but I'm completely lost as to what I'm doing wrong here :l
I'm sorry, but I'm completely lost as to what I'm doing wrong here :l
Where are loop() and setup()?
here
and here
EDIT: There seems to be an extra pinmode setup in there, I have removed it now :o
Sorry for slow replies, this 5 minute filter is evil.
Thank you! I strive to make my code as cute and symmetrical as possible ![]()
I thought if a line was commented out, the compiler wouldn't read any of it. I've never seen this behaviour before.
By the way, I'm very sorry if posting pictures of code is against the rules! I am aware of the code tags, but pasting images was faster.
Use this format if you want to do that:
/* symmetrical comments go here */
/*
or for multiline
comments,
do this
*/
CrossRoads:
/* symmetrical comments go here */
Thank you! I guess I'll have to use this from now on! Or just live with ugly comments ![]()
Delta_G:
That is exactly right. And the \ symbol at the end of a comment means, "the comment continues on the next line too." It tells the compiler not to read the next line either.
But that means the compiler is reading 1 character from a line I told it to ignore. Which brings up another question. What if I put a character after the \ ?
What if
It's very easy to try it out ![]()
Delta_G:
If it's working code you want then don't worry about how pretty the comments are. don't bother with coding it's just going to frustrate you.
Apologies if I'm mistaken, but are you suggesting I should give up because you disagree with my practice? Surely you'd agree that one of the most important things in programming is being able to debug your own code?
LarryD:
It's very easy to try it out
Don't worry, I have! I was simply thinking aloud!
BTW, this may be something you might want to look through.
See Trap#14. The problem you had discussed here.
.
Delta_G:
You have a choice where to put your energy, making things pretty or making things work. Code that doesn't work is a bit useless.
You're implying that pretty code doesn't work! I assure you, you're wrong ![]()
Delta_G:
being able to debug your code is of the ultimate importance. The "cuteness" of your comments doesn't affect that at all.
Maybe not for you
Can I just point out that I happened to stumble across the one exception, that applies to this language only? lol
Delta_G:
pretty-ing up your comments is what got you into trouble here.
You make a good point, but if my comments don't stand out to me, the development process takes much longer.
LarryD:
See Trap#14.
Well then...! ![]()
Kounipo:
I thought if a line was commented out, the compiler wouldn't read any of it. I've never seen this behaviour before.
There's a sequence of things that the compiler does when it reads your input file. Interpreting end-of-line escapes is one of the first things it does. Working out what is a comment and what isn't occurs quite a bit after this.
If you haven't seen that behaviour before, it's probably because you had a blank line after the comment.
PaulMurrayCbr:
a blank line after the comment.
Genius!!! My comments CAN BE PRETTY! ![]()
Kounipo:
Can I just point out that I happened to stumble across the one exception, that applies to this language only? lol
You "stumble" across a forty-plus year old language feature?
AWOL:
You "stumble" across a forty-plus year old language feature?
Why does it matter how old the language is? I've just started learning C, it could have been added last week and I'd still have stumbled over it ![]()