How to make io on/off(m42 pn s255/0) by just one macros
-
How to make io on/off(m42 pn s255/0) by just one macros
by c or c++,i just need as thus:
if s=255
s=0
or
s=255But idont know can gcode do that?
I read GCode Meta Commands,still find no way。(https://duet3d.dozuki.com/Wiki/GCode_Meta_Commands#Section_Programming_constructs)huai
-
-
@oliof I m just too noob,that i need to know how to write it concrete
[I have use “OUT7” on duet3 6hc,M950 S2 C"OUT7"Q65535,And i try write this in macros :
(If OUT7.pwm==0
M42 P2 S1
else
M42 P2 S0)
but it warn with:(Error: Failed to read code from macro Z-axis-brake: unexpected else in line 3)]
THANKS
huai -
@huai3895 can you post the code of your config.g where you create the pin ?
-
@Donpi M950 P2 C"!OUT7" Q65535
-
-
@huai3895
Remove the brackets (...) -
@Donpi yes ,it works
-
-
@Donpi the () just make easy to show you code,infact i never write it in my macros
-
@huai3895 But i still find something:with duet3&raspberry pi(duet pi with GUI) ,M409 just report nothing, so mabe its just a bug with duet pi?