
clear all;
close all;

s = serial('/dev/tty.usbmodem0E203E21');
%s = serial('/dev/tty.usbmodem621', 'BaudRate', 9600);
 
answer=1; % this is where we'll store the user's answer
 
fopen(s); % initiate  communication
 
while answer
    fprintf(s,'%s',char(answer)); % send answer variable content
    answer=input('Ingresa un 1 o 2 (1=ENCENDER, 2=APAGAR, 0=SALIR): '); % ask user to enter value for variable answer
end
 
fclose(s); % end communication with Tiva C