AC for running the transformer

for(i;i<256;i++)

How about initializing "i"?

Analogue out 9 != analogue in 9