Using ADC value to create timer on delay (by Jason)
I want to use an ADC value to alter a timer delay.
My intention is to use a potentiometer to set a time delay period.
ie. to run an operation for a pre determined time which is set by the potentiometer.
Im working on a little homebrew project for a friend who wants to automate a bottle washer
Any help or ideas would be most appreciated
(no subject) (by Chris)
The generic recipe is this.
LDmicro export text
no MCU assigned, 4.000000 MHz crystal, 100.0 ms cycle time
LADDER DIAGRAM:
|| ||
|| Xinput _ ATime ||
001||-------] [------+----[OSR_/ ]----+--------------------{READ ADC}---- ||
|| | | ||
|| | _ | ||
|| +----[OSF \_]----+-------------------{MASTER RLY}--- ||
|| | ||
|| Rinit_done | ||
||-------]/[-----------------------+ ||
|| ||
|| ||
|| ||
|| ||
|| {MUL Atime :=} ||
002||-------------------------------------------{ Atime * 3 }--------- ||
|| ||
|| {ADD Atime :=} ||
||-------------------------------------------{ Atime + 100 }--------- ||
|| ||
|| ||
|| ||
|| ||
|| ||
003||-----------------------------------------------------{MASTER RLY}--- ||
|| ||
|| ||
|| ||
|| ||
|| Xinput [Atime >] {SUB Atime :=} ||
004||-------] [------+----[ 0 ]-------------{ Atime - 1 }--------- ||
|| | ||
|| | [Atime ==] Youtput ||
|| +---[ 0 ]----------------------------( )------- ||
|| ||
|| ||
|| ||
|| ||
|| Rinit_done ||
005||----------------------------------------------------------( )------- ||
|| ||
|| ||
|| ||
||------[END]--------------------------------------------------------- ||
|| ||
|| ||