mirror of
https://github.com/tinygo-org/drivers.git
synced 2026-08-16 12:53:23 +00:00
whoops, forgot to change easystepper method calls
This commit is contained in:
committed by
deadprogram
parent
8ac285e821
commit
97ed81556b
+49
-49
@@ -63,7 +63,7 @@ func (d *Device) Move(steps int32) {
|
|||||||
// Off turns off all motor pins
|
// Off turns off all motor pins
|
||||||
func (d *Device) Off() {
|
func (d *Device) Off() {
|
||||||
for _, pin := range d.pins {
|
for _, pin := range d.pins {
|
||||||
pin(false)
|
pin.Low()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -124,28 +124,28 @@ func (d *Device) stepMotor(step uint8) {
|
|||||||
func (d *Device) stepMotor4(step uint8) {
|
func (d *Device) stepMotor4(step uint8) {
|
||||||
switch step {
|
switch step {
|
||||||
case 0:
|
case 0:
|
||||||
d.pins[0](true)
|
d.pins[0].High()
|
||||||
d.pins[1](false)
|
d.pins[1].Low()
|
||||||
d.pins[2](true)
|
d.pins[2].High()
|
||||||
d.pins[3](false)
|
d.pins[3].Low()
|
||||||
break
|
break
|
||||||
case 1:
|
case 1:
|
||||||
d.pins[0](false)
|
d.pins[0].Low()
|
||||||
d.pins[1](true)
|
d.pins[1].High()
|
||||||
d.pins[2](true)
|
d.pins[2].High()
|
||||||
d.pins[3](false)
|
d.pins[3].Low()
|
||||||
break
|
break
|
||||||
case 2:
|
case 2:
|
||||||
d.pins[0](false)
|
d.pins[0].Low()
|
||||||
d.pins[1](true)
|
d.pins[1].High()
|
||||||
d.pins[2](false)
|
d.pins[2].Low()
|
||||||
d.pins[3](true)
|
d.pins[3].High()
|
||||||
break
|
break
|
||||||
case 3:
|
case 3:
|
||||||
d.pins[0](true)
|
d.pins[0].High()
|
||||||
d.pins[1](false)
|
d.pins[1].Low()
|
||||||
d.pins[2](false)
|
d.pins[2].Low()
|
||||||
d.pins[3](true)
|
d.pins[3].High()
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
d.stepNumber = step
|
d.stepNumber = step
|
||||||
@@ -155,45 +155,45 @@ func (d *Device) stepMotor4(step uint8) {
|
|||||||
func (d *Device) stepMotor8(step uint8) {
|
func (d *Device) stepMotor8(step uint8) {
|
||||||
switch step {
|
switch step {
|
||||||
case 0:
|
case 0:
|
||||||
d.pins[0](true)
|
d.pins[0].High()
|
||||||
d.pins[2](false)
|
d.pins[2].Low()
|
||||||
d.pins[1](false)
|
d.pins[1].Low()
|
||||||
d.pins[3](false)
|
d.pins[3].Low()
|
||||||
case 1:
|
case 1:
|
||||||
d.pins[0](true)
|
d.pins[0].High()
|
||||||
d.pins[2](true)
|
d.pins[2].High()
|
||||||
d.pins[1](false)
|
d.pins[1].Low()
|
||||||
d.pins[3](false)
|
d.pins[3].Low()
|
||||||
case 2:
|
case 2:
|
||||||
d.pins[0](false)
|
d.pins[0].Low()
|
||||||
d.pins[2](true)
|
d.pins[2].High()
|
||||||
d.pins[1](false)
|
d.pins[1].Low()
|
||||||
d.pins[3](false)
|
d.pins[3].Low()
|
||||||
case 3:
|
case 3:
|
||||||
d.pins[0](false)
|
d.pins[0].Low()
|
||||||
d.pins[2](true)
|
d.pins[2].High()
|
||||||
d.pins[1](true)
|
d.pins[1].High()
|
||||||
d.pins[3](false)
|
d.pins[3].Low()
|
||||||
case 4:
|
case 4:
|
||||||
d.pins[0](false)
|
d.pins[0].Low()
|
||||||
d.pins[2](false)
|
d.pins[2].Low()
|
||||||
d.pins[1](true)
|
d.pins[1].High()
|
||||||
d.pins[3](false)
|
d.pins[3].Low()
|
||||||
case 5:
|
case 5:
|
||||||
d.pins[0](false)
|
d.pins[0].Low()
|
||||||
d.pins[2](false)
|
d.pins[2].Low()
|
||||||
d.pins[1](true)
|
d.pins[1].High()
|
||||||
d.pins[3](true)
|
d.pins[3].High()
|
||||||
case 6:
|
case 6:
|
||||||
d.pins[0](false)
|
d.pins[0].Low()
|
||||||
d.pins[2](false)
|
d.pins[2].Low()
|
||||||
d.pins[1](false)
|
d.pins[1].Low()
|
||||||
d.pins[3](true)
|
d.pins[3].High()
|
||||||
case 7:
|
case 7:
|
||||||
d.pins[0](true)
|
d.pins[0].High()
|
||||||
d.pins[2](false)
|
d.pins[2].Low()
|
||||||
d.pins[1](false)
|
d.pins[1].Low()
|
||||||
d.pins[3](true)
|
d.pins[3].High()
|
||||||
}
|
}
|
||||||
d.stepNumber = step
|
d.stepNumber = step
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user