module main author unknown version 1 0 description '' variables PWM spec ' ' 'MotorFan' 'MotorFan _ _ _' 'num bool auto' 23 true 500 to MotorFan Pin State Speed { if (and (Speed > 0) (Speed <= 100)) { PWM = (absoluteValue (((Speed - 1) * ((1023 - 1) / 99)) + 1)) if (State == (booleanConstant true)) { if (and (PWM > 0) (PWM < 1024)) {analogWriteOp Pin PWM} } else { digitalWriteOp Pin false } } } script 134 74 { to MotorFan {} } script 695 150 { whenStarted comment 'Enter (Pin, State, Speed%)' MotorFan 23 true 12 waitMillis 1000 MotorFan 23 false 10 }