Skip to content
Snippets Groups Projects
Commit d97cdd5c authored by Jake Read's avatar Jake Read
Browse files

w/r/t last commit, find that 'state' not 'var state' to declare reference, so...

w/r/t last commit, find that 'state' not 'var state' to declare reference, so global scope applied. JS u nasty
parent 433af7ad
Branches
No related tags found
No related merge requests found
......@@ -137,20 +137,16 @@ zm.outputs.ack.attach(planner.inputs.acks)
// same motors / bridge
xm.state.axis = 'X'
xm.axis = 'X'
xm.outputs.packet.attach(bridge.inputs.A)
bridge.outputs.A.attach(xm.inputs.packet)
yma.state.axis = 'Y'
yma.axis = 'Y'
yma.outputs.packet.attach(bridge.inputs.B)
bridge.outputs.B.attach(yma.inputs.packet)
ymb.state.axis = 'Y'
ymb.axis = 'Y'
ymb.state.spu = -200
ymb.outputs.packet.attach(bridge.inputs.C)
bridge.outputs.C.attach(ymb.inputs.packet)
zm.state.axis = 'ZA'
zm.axis = 'Z'
zm.outputs.packet.attach(bridge.inputs.D)
bridge.outputs.D.attach(zm.inputs.packet)
......
......@@ -19,7 +19,9 @@ function Stepper() {
}
stepper.state = State()
state = stepper.state
var state = stepper.state
// is it shallow state?
// var state, not state :|
state.axis = 'X'
state.spu = 200 // steps per unit
......@@ -65,7 +67,8 @@ function Stepper() {
}
function onNewInstruction(move) {
console.log('move to stepper', stepper.id, state.axis, stepper.axis, stepper.state.axis)
console.log('move to stepper', stepper.id, stepper.state.axis, state.axis)
console.log('STATE', state, "STP.STT", stepper.state)
// pick out axis (check if it's a wait move)
// like
/*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment