iS my photoresistor (LDR) too slow ? || tachometer

smeezekitty:
100hz is too fast for the Arduino? shrug :roll_eyes:

No it isn't but I've found I have to be clever when polling anything at the same time as I'm reading and writing to lcd's. I suspect the same might be true for serial devices. To keep loop execution speed below 5ms on this latest project, I had to limit the reading and writing to one command per loop.

switch (lcd_command % 11)			// display updated one command at a time
	{				// to decrease loop execution time
	case 0:
		lcd.setCursor(0, 0);			// column 0 line 0
		break;
	case 1:
		if (run_state == RUN_RUNNING)
			lcd.print("Running   ");
		else
			lcd.print("Stopping  ");
		break;
	case 2:
		lcd.setCursor(10, 0);			// column 9 line 0
		break;
	case 3:
		lcd.print(cycle_count);
		break;
	case 4:
		lcd.print("c     ");
		break;
	case 5:
		lcd.setCursor(0, 1);			// column 0 line 1
		break;
	case 6:
		lcd.print(lcd_tenths / 10);
		break;
	case 7:
		lcd.print("s     ");
		break;
	case 8:
		lcd.setCursor(10, 1);			// column 9 line 1
		break;
	case 9:
		lcd.print(sense_count);
		break;
	case 10:
		lcd.print("p     ");
		break;
	}
	lcd_command++;		// increment for next iteration