This project shows how you can emulate a "sawtooth" made with a bunch of square waves by subtracting a second sawtooth waveform.
Here's the square project: https://scratch.mit.edu/projects/412396362/