creating code for a square wave output and sine wave output

You can build a four or five bit DAC easily with an R-2R resistor ladder (useful Google search term)

is there a way to do it using the circuit i already have for my project? the schematic is below
http://www.instructables.com/file/F6DPG7PGZMIUHMJ