Set a number in your graph to the pressCount
number(
n): button.pressCount
Then next to one of the dimensions, or one of the center coordinates, add:
{mod(n,2)=1}
Is it necessary to have a graph component for this? I just want a button to toggle a display between two equations for students… I suppose I could have a graph component but make it hidden the whole time…
I got this working but it only switches once, then it stays on one displayed note. I’d like it to continue to switch between note1a and note1b. I made the graph display to try to debug, showing y=a{mod(a,2)=1}
and its a flat line only defined for odd numbers but it continues to increase with button pushes…
Got it! Edited in my solution. Defined a variable b=mod(a,2)
where number('a'): button.pressCount
and switch the displayed notes based on b
, not a
, using hidden: