function [out] = bioptechs(temperature)
%expects a temperature in the range 25 to 75
%in INTEGERS ONLY
temperature = double(temperature / 10);

PORT = 'COM4';
b = PORT;
p = serial(b); % creating a serial port object for input port 'b'
set(p,'BaudRate',9600);
set(p,'Terminator','CR');
set(p,'Timeout',100);
fopen (p);

num = round(4095*(volt/10));
num1 = floor(num/256);
num2 = num - num1*256;

%fwrite(p,1,'uint8'); %COMMAND 1 IS TO SET DAC CHANNEL 1
%fwrite(p,num1,'uint8');
%fwrite(p,num2,'uint8');

fwrite(p, [1 num1 num2], 'uint8');

R1 = fread(p,1,'uint8');    % 1 - success, 0 - failure
R2 = fread(p,1,'uint8');    % doesn't matter (you'll get 0)
R3 = fread(p,1,'uint8');    % doesn't matter (you'll get 0)

fclose(p);

out = R1;
