Kurt
There are three tinyG pins in play here
- PWM - You get a PWM signal when M3 active NOT APPROPRIATE
- SPIN ON/Off - High logic level when M3 active (M5 turns off)
- Coolant - High logic level when M7 active.(M9 turns off)
The insertion of M3 and M7 at appropriate points in your GCode is really a function of your GCode generator; some do, some don’t.
Or, you could do it manually.
A separate solution (independent of tinyG) would be to use the CP GPIO server and use your Pi 2 pins to drive relays
I doubt there are packages that would generate appropriate control for the Pi pins automatically, but you could create something on your own using CP Macros or ?