added PWM and tmp workspace
parent
8d7e83113b
commit
f2f2326488
@ -0,0 +1,5 @@
|
||||
# PWM
|
||||
|
||||
## Resources
|
||||
|
||||
- [PWM L298N Article](https://howtomechatronics.com/tutorials/arduino/arduino-dc-motor-control-tutorial-l298n-pwm-h-bridge/)
|
@ -0,0 +1,24 @@
|
||||
from machine import Pin, PWM
|
||||
from time import sleep
|
||||
print("Clank controller coming online")
|
||||
|
||||
# pwm0 = PWM(Pin(0)) # create PWM object from a pin
|
||||
# pwm0.freq() # get current frequency
|
||||
# pwm0.freq(1000) # set frequency
|
||||
# pwm0.duty() # get current duty cycle
|
||||
# pwm0.duty(200) # set duty cycle
|
||||
# pwm0.deinit() # turn off PWM on the pin
|
||||
|
||||
|
||||
pwm12 = PWM(Pin(12), freq=1000, duty=0)
|
||||
pwm13 = PWM(Pin(13), freq=1000, duty=0)
|
||||
|
||||
while True:
|
||||
pwm12.duty(512)
|
||||
sleep(2)
|
||||
pwm12.duty(0)
|
||||
sleep(.3)
|
||||
pwm13.duty(512)
|
||||
sleep(2)
|
||||
pwm13.duty(0)
|
||||
sleep(.3)
|
@ -0,0 +1 @@
|
||||
*.py
|
@ -0,0 +1,20 @@
|
||||
# Temporary workspace
|
||||
|
||||
Content in this directory should never be uploaded to git.
|
||||
|
||||
## Usage
|
||||
|
||||
Use this space to pull down files and rapidly iterate on them
|
||||
|
||||
Pull files:
|
||||
```
|
||||
source scripts/profile
|
||||
upy ls
|
||||
upy get <board_file> tmp/<file>
|
||||
```
|
||||
|
||||
Upload files back
|
||||
```
|
||||
upy put tmp/<file> <board_file>
|
||||
|
||||
```
|
Loading…
Reference in New Issue