So... Read a pin...( you must condition this input to 3v+ ) each time the pin is high set a voltage on the out put
if you put R2R ladder on three pins and just count 0 ~ 7 and then 7 ~ 0.. outputting this count on the ladder, your voltage will look like the documentation.
array [] = { 0,1,2,3,4,5,6,7,6,5,4,3,2,1}; // sine wave
output this array over the three pins each time your input pin goes high..
If you think I'm going to do it for you, you are wrong... You write some code, I'll check it and give you pointers..