Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
A micropython library to use stepper motors in a tidy way.
Your steppers should be connected to a stepper driver that is controlled using a step, a dir and optional an enable pin.
This library uses one timer per stepper to achive controlled speeds for multiple steppers in a non blocking way.
The steppers can be controlled by angle if the number of steps per rotation is supplied.
Multiple steppers can share a common dir pin, allowing for N steppers controlled by N+1 output pins.
from stepper import Stepper
import time
s1 = Stepper(18,19,steps_per_rev=200,speed_sps=50)
s2 = Stepper(20,21,steps_per_rev=200,speed_sps=50)
s1.target_deg(90)
s2.target_deg(45)
time.sleep(5.0)
s1.target_deg(0)
s2.target_deg(5)
time.sleep(5.0)
import machine
import time
from stepper import Stepper
s1 = Stepper(18,19,steps_per_rev=200)
#create an input pin for the end switch (switch connects pin to GND)
endswitch = machine.Pin(2, machine.Pin.IN, machine.Pin.PULL_UP)
s1.speed(20) #use low speed for the calibration
s1.free_run(-1) #move backwards
while endswitch.value(): #wait till the switch is triggered
pass
s1.stop() #stop as soon as the switch is triggered
s1.overwrite_pos(0) #set position as 0 point
s1.target(0) #set the target to the same value to avoid unwanted movement
s1.speed(100) #return to default speed
s1.track_target() #start stepper again
#calibration finished. Do something else below.
s1.target_deg(45)
time.sleep(5.0)
import machine
from stepper import Stepper
dir_pin = machine.Pin(19,machine.Pin.OUT)
s1 = Stepper(18,dir_pin,steps_per_rev=200,speed_sps=50)
s2 = Stepper(20,dir_pin,steps_per_rev=200,speed_sps=50)
speed(sps)
speed_rps(rps)
target(t)
target_deg(deg)
target_rad(rad)
get_pos()
get_pos_deg()
get_pos_rad()
overwrite_pos(p)
overwrite_pos_deg(deg)
overwrite_pos_rad(rad)
step(d)
free_run(d)
track_target()
stop()
enable(e)
is_enabled()
FAQs
Library to use stepper drivers in micropython in a tidy way
We found that micropython-stepper demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.