Using DIP Switches to scale a result on a LCD


I am new to this and i have hit a bump in the road.

I am counting pulses and i apply a formula to scale the results eg. 1 pulse = 10gallons

What i need to do now is work out how to use dip switches to apply different formulas. eg 1 pulse = 10 gal or 1 pulse = 100 gal depending on the dip switch selected.

Any help would be much appreciated.

OK, game rules.

Show us your (current or proposed) code - in "code" tags (the [ # ] icon above the submission window) and explain where the two DIP switches will be connected, and we can explain the answer.

Hi ausbeno,

Attach each dip switch between an Arduino pin and ground and set those pins to INPUT_PULLUP. Then you have the choice of reading the state of the dip switches either once at startup or each time you detect a pulse. From the state of the dip switches, determine what factor to apply to the pulse count.