added PWM and tmp workspace

master
Drew Bednar 4 years ago
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)

@ -5,12 +5,19 @@ ARG=$1
if [ "$ARG" = '--kit' ] || [ "$ARG" = '-k' ]; then if [ "$ARG" = '--kit' ] || [ "$ARG" = '-k' ]; then
echo "Using ESP-WOVER-kit_v4.1" echo "Using ESP-WOVER-kit_v4.1"
export AMPY_PORT=/dev/cu.usbserial-143101 # export AMPY_PORT=/dev/cu.usbserial-143101
export AMPY_PORT=/dev/cu.usbserial-14401
fi fi
function _set_kit_usbserial (){
}
function repl_connect (){ function repl_connect (){
echo "Connecting to $AMPY_PORT" echo "Connecting to $AMPY_PORT"
echo "Use Ctrl+a then k to kill the session"
sleep 2;
screen $AMPY_PORT $BAUD_RATE screen $AMPY_PORT $BAUD_RATE
} }

1
tmp/.gitignore vendored

@ -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…
Cancel
Save