Hello Guest it is May 29, 2024, 05:10:57 AM

### Author Topic: Spindle Override  (Read 1760 times)

0 Members and 1 Guest are viewing this topic.

#### Ron Ginger

• 925
##### Spindle Override
« on: May 01, 2018, 07:48:18 AM »
I have built a panel with a PoKey56E and several buttons, and 3 pots. I want to control Feed, Rapid and Spindle overrive.

The example in the PoKeys doc shows converting the analog reading for Feed and Rapid to a number between 0 and 100. It does not show an example for Spindle. I have found the spindle function requires a 0 to 1 number, not 0 to 100.

I suspect this is a bug?

#### Cbyrdtopper

• 910
##### Re: Spindle Override
« Reply #1 on: May 01, 2018, 08:21:26 AM »
Hey Ron,
Check this macro out.  It shows how to get and set the FRO, RRO, and SSO.  FRO and RRO return 0-250 and 0-100.  SSO returns 0.5-1.5

function m309()
local inst = mc.mcGetInstance()
local FRO = mc.mcCntlGetFRO(inst)--Returns:  0 - 250
local RRO = mc.mcCntlGetRRO(inst)--Returns:  0 - 100
local SSO = mc.mcSpindleGetOverride(inst)--Returns:  0.5 - 1.5

mc.mcCntlSetFRO(inst, 135)
mc.mcCntlSetRRO(inst, 75)
mc.mcSpindleSetOverride(inst, 1.2)

mc.mcCntlSetFRO(inst, 100)
mc.mcCntlSetRRO(inst, 100)
mc.mcSpindleSetOverride(inst, 1.0)

end --m309()

if (mc.mcInEditor() == 1) then
m309 ()
end