Uploading

This commit is contained in:
fatimaxsen committed 2025-06-03 14:02:19 +03:00
1 parent 26bd63e232
commit f40675acb1
12 files changed
+218 -1

No files matched your search

+1 -1
View File
@@ -3,7 +3,7 @@ Displaying the version and its functions with examples.
## Version 01
In these functions, you must specify the I2C pin corresponding to the module you are using.
In these functions, you must specify the PWM pin corresponding to the module you are using.
![](Images/1.png)
+53
View File
@@ -0,0 +1,53 @@
module main
author unknown
version 1 0
description ''
spec ' ' 'Fan Motor' 'Fan Motor Pin _ to Turn Off' 'num' 17
spec ' ' 'Fan Motor Pin' 'Fan Motor Pin _ Direction _ Speed _' 'num bool auto' 17 true 50
to 'Fan Motor' Pin {
digitalWriteOp (Pin + 1) false
digitalWriteOp (Pin + 2) false
}
to 'Fan Motor Pin' Pin Direction Speed {
if (and (Speed > 0) (Speed <= 100)) {
local 'PWM' (absoluteValue (((Speed - 1) * ((1023 - 1) / 99)) + 1))
if (Direction == (booleanConstant false)) {
if (and (PWM > 0) (PWM < 1024)) {
digitalWriteOp (Pin + 1) true
analogWriteOp (Pin + 2) (1023 - PWM)
}
} else {
if (and (PWM > 0) (PWM < 1024)) {
digitalWriteOp (Pin + 1) false
analogWriteOp (Pin + 2) PWM
}
}
}
}
script 50 168 {
to 'Fan Motor' {}
}
script 66 341 {
to 'Fan Motor Pin' {}
}
module Spark_PWM Control
author 'Fab Lab'
version 1 0
description ''
spec ' ' 'FanMotor' 'FanMotor Pin _ Direction _ Speed _' 'num bool num' 17 true 50
spec ' ' 'FanMotor2' 'FanMotor Pin _ to Turn Off' 'auto' 18
to FanMotor Pin Direction Speed {
}
to FanMotor2 Pin {
}