Notifications
Clear all

having some trouble with an if then statement triggered by a High reading on a digital pin/switch

16 Posts
6 Users
16 Likes
2,587 Views
frogandtoad
(@frogandtoad)
Member
Joined: 5 years ago
Posts: 1458
 

@zander

Posted by: @zander

@will Good 2nd point Will. This is why it is important to call a variable by it's full nbame so to speak when declaring them. If it is in fact a constant then declaring it 'const' will stop you from making a mistake.

I agree with you in using full names, and actually I advocate the use of proper variable names instead of silly acronyms that save a few characters!

Likewise, use a constant whenever you KNOW that a value will NOT change.

In this case however, we know the 'speedmode' variable is expected to change, otherwise there would be no need to check it's value 😉

Cheers


   
Ron reacted
ReplyQuote
Page 2 / 2