'write to Digital Potentiometer by value sub writeDPval(byval setValue as byte) dim dsRST as byte dim dsCLK as byte dim dsDQ as byte dim header as byte dim pw as integer 'ds1267 reset pin on bx dsRST=5 'ds1267 clock pin on bx dsCLK=6 'ds1267 data pin on bx dsDQ=7 'header byte for choosing pot header=0 'pulse with for pulseout pw=5 call putPin(dsRST,1) call delay(0.001) call pulseout(dsCLK,pw,1) call shiftout(dsDQ,dsCLK,8,header) call shiftout(dsDQ,dsCLK,8,setValue) call delay(0.001) call putpin(dsRST,0) call delay(0.001) End Sub 'write to Digital Potentiometer by reference sub writeDP(setValue as byte) dim dsRST as byte dim dsCLK as byte dim dsDQ as byte dim header as byte dim pw as integer 'ds1267 reset pin on bx dsRST=5 'ds1267 clock pin on bx dsCLK=6 'ds1267 data pin on bx dsDQ=7 'header byte for choosing pot header=0 'pulse with for pulseout pw=5 call putPin(dsRST,1) call delay(0.001) call pulseout(dsCLK,pw,1) call shiftout(dsDQ,dsCLK,8,header) call shiftout(dsDQ,dsCLK,8,setValue) call delay(0.001) call putpin(dsRST,0) call delay(0.001) End Sub