Pushing
This commit is contained in:
commit
1f4f985e64
BIN
Images/1.png
Normal file
BIN
Images/1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 138 KiB |
BIN
Images/2.png
Normal file
BIN
Images/2.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 84 KiB |
BIN
Images/3.png
Normal file
BIN
Images/3.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 131 KiB |
BIN
Images/4.png
Normal file
BIN
Images/4.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 140 KiB |
44
MotorFanLibrary.ubp
Normal file
44
MotorFanLibrary.ubp
Normal file
@ -0,0 +1,44 @@
|
||||
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 {}
|
||||
}
|
||||
|
26
MotorFanLibraryv2.ubp
Normal file
26
MotorFanLibraryv2.ubp
Normal file
@ -0,0 +1,26 @@
|
||||
module main
|
||||
author unknown
|
||||
version 1 0
|
||||
description ''
|
||||
|
||||
spec ' ' 'MotorFan' 'MotorFan _ _ _' 'num bool auto' 23 true 500
|
||||
|
||||
to MotorFan Pin State Speed {
|
||||
if (State == (booleanConstant true)) {
|
||||
if (and (Speed > 0) (Speed < 1024)) {analogWriteOp Pin Speed}
|
||||
} else {
|
||||
digitalWriteOp Pin false
|
||||
}
|
||||
}
|
||||
|
||||
script 67 68 {
|
||||
to MotorFan {}
|
||||
}
|
||||
|
||||
script 628 144 {
|
||||
whenStarted
|
||||
MotorFan 23 true 500
|
||||
waitMillis 1000
|
||||
MotorFan 23 false 10
|
||||
}
|
||||
|
31
MotorFanLibraryv3.ubp
Normal file
31
MotorFanLibraryv3.ubp
Normal file
@ -0,0 +1,31 @@
|
||||
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
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user