QuotelastTimeEventOccuredIn that situation I would name the event. lastTimeButtonAPressed, or lastTimeObjectPassedSensor3.
Quote from: majenko on Jun 08, 2012, 11:30 amQuotelastTimeEventOccuredIn that situation I would name the event. lastTimeButtonAPressed, or lastTimeObjectPassedSensor3.Usually, you should be able to do better than that: Sensor3 presumably is a physical device of some type, its name should reflect it e.g. lastTimeObjectPassedCrankshaftHallSensor. I'd agree that that's getting uncomfortably long, but having variables distinguished only by number makes your code harder to follow/maintain.
int pinForVeeblefeetzerSensor1;int pinForVeeblefeetzerSensor2;int pinForVeeblefeetzerSensor3;int pinForVeeblefeetzerSensor4;int pinForVeeblefeetzerSensor5;int pinForVeeblefeetzerSensor6;int pinForVeeblefeetzerSensor7;int pinForVeeblefeetzerSensor8;
byte veeblefeetzerSensorPin[ 8 ];
And of course we all hope to learn at the company picnic just what a Veeblefeetzer does.
That's just plane ridiculous, for a simple value that's very local 1-char names are acceptable IMO.