Can anyone help me to make a square wave of 80% duty cycle on Lua? Its amplitude should vary from -10 to -40 during first 80% of the period. After that I want to make the square wave similar to a real

can anyone help me to make a lua code for this?