Page 1 of 1

Sharing: Metronome Macro Button

Posted: 13 Dec 2019 14:29
by TonyR
Created a metronome button that switches on when off and vice versa. Sharing for anyone that could use it.

I don't know how to upload the .dat file, so here is the code. Please note, remove “(indent spaces)” in the code and just add a few spaces in there.
# Macro Metronome
metval = dtmacro.get_metronome()
if metval:
(indent spaces) metval = 0
(indent spaces) showmsg = "off"
else:
(indent spaces) metval = 1
(indent spaces) showmsg = "on"
# dtmacro.show_status_msg_wait(showmsg)
dtmacro.set_metronome(metval)
# Macro Metronome code end
Would appreciate if someone can tell me how to upload .dat files to this forum for sharing.

Re: Sharing: Metronome Macro Button

Posted: 13 Dec 2019 16:11
by DT_bettinzana
TonyR wrote:
13 Dec 2019 14:29
Created a metronome button that switches on when off and vice versa. Sharing for anyone that could use it.

I don't know how to upload the .dat file, so here is the code. Please note, remove “(indent spaces)” in the code and just add a few spaces in there.
# Macro Metronome
metval = dtmacro.get_metronome()
if metval:
(indent spaces) metval = 0
(indent spaces) showmsg = "off"
else:
(indent spaces) metval = 1
(indent spaces) showmsg = "on"
# dtmacro.show_status_msg_wait(showmsg)
dtmacro.set_metronome(metval)
# Macro Metronome code end
Would appreciate if someone can tell me how to upload .dat files to this forum for sharing.
Hello and thank you for the macro. It is useful for all the other users to read a piece of code.
Anyway, in this case DTouch already has a "Standard Function Button" (check the section "Transport") named "Click ON/OFF". The advantage of this button is that it shows the status.

To upload a .dat file you can use the "attachements" function of this forum. It appears when you write a post.

Re: Sharing: Metronome Macro Button

Posted: 13 Dec 2019 17:21
by TonyR
Thanks. I didn’t see that one in the button selection menu. :oops: