Spark_FanMotor/MotorFanLibrary.ubp
2025-05-27 10:14:47 +03:00

45 lines
944 B
Plaintext

module main
author unknown
version 1 0
description ''
spec ' ' 'MotorFan' 'MotorFan _ _' 'num bool' 10 true
spec ' ' 'MotorSpeed' 'MotorSpeed _ _' 'auto auto' '10' '10'
to MotorFan Pin State {
comment 'اوصل محرك المروحة بالمنفذ الذي وضعته'
comment 'حدد حالة المحرك '
if (State == (booleanConstant true)) {
digitalWriteOp Pin true
} else {
digitalWriteOp Pin false
}
}
to MotorSpeed Pin Speed {
comment 'اوصل محرك المروحة بالمنفذ الذي وضعته'
comment 'ضع السرعة التي تودها'
comment 'محرك المروحة يعمل وفقا للسرعة الموضوعة'
if (and (Speed > 0) (Speed < 1024)) {
analogWriteOp Pin Speed
} else {
digitalWriteOp Pin false
}
}
script 67 68 {
to MotorFan {}
}
script 451 147 {
whenStarted
MotorSpeed 23 500
waitMillis 1500
MotorSpeed 23 0
}
script 66 369 {
to MotorSpeed {}
}