close all
clear all

outfile = 'BK_dump.txt';
fp=fopen(outfile,'a');

sp = serial('COM4', 'BaudRate', 38400);
fopen(sp);

BK_EnableRemote(sp,1);
BK_SetCCMode(sp);
BK_LoadOn(sp,1);

BK_SetCurrent(sp,.22);

while(1)
   [V,I,err] =BK_ReadVandI(sp);
   t = datetime;
   fprintf('%s %f %f\n',t,V,I);
   fprintf(fp,'%s %f %f\n',t,V,I);
   pause(.1);
end

fclose(sp);
fclose(fp);