Comments (1)
YES, I answer myself. I'm happy that is something quite simple. I will try to write a Gobot driver for DRV8825 stepper controller. This is a sample code, that works for me on a RPI4 (If it doesn't work play with time on gobot.Every sentence):
package main
import (
"time"
"gobot.io/x/gobot/v2"
"gobot.io/x/gobot/v2/platforms/raspi"
)
func main() {
r := raspi.NewAdaptor()
work := func() {
// Direction Pin (DRV8825 DIR)
r.DigitalWrite("37", 1)
step := true
gobot.Every(1*time.Millisecond, func() {
if step {
// Step pin (DRV8825 STP)
r.DigitalWrite("35", 1)
step = false
} else {
r.DigitalWrite("35", 0)
step = true
}
})
return
}
robot := gobot.NewRobot("stepperBot",
[]gobot.Connection{r},
[]gobot.Device{},
work,
)
robot.Start()
}
from gobot.
Related Issues (20)
- roadmap(AIO): use variadic constructor functions to allow for additional params, similar to i2c drivers HOT 1
- roadmap(i2c): MMA8452 3-Axial Accelerometer
- roadmap(I2C): VCNL4010 distance/light sensor module
- roadmap(1-wire): add support for 1-wire protocol HOT 1
- roadmap(serial): create a common serial adaptor HOT 1
- roadmap(ble): implement support for more peripherals HOT 2
- Support for Sphero BOLT HOT 3
- adafruit_driver.go contains shared variables and init() HOT 1
- avoid master/slave terminology HOT 1
- code and test contains data race HOT 2
- PCA9685 wrong initialisation HOT 2
- golangci-lint v1.55.2 is there HOT 1
- raspi with gpio.servo not work (like expected) HOT 1
- HX711 Support HOT 2
- Go 1.22 is released
- Write pwm export() failed for id xx "with open gpiochip0" HOT 4
- Stepper over MCP23017
- Drones
- Do you have any plan to add Waveshare LCD Driver?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gobot.