Chess GUI on Matlab connected to Arduino

Hello,
I have a task to do Chess GUI on Matlab that shows the state of my digital chess board, I made a digital chess board with Arudino controller. From Arduio I get through serial port state of the chess board. With this code I get information from Arduino, the result of this code is an 8x8 matrix with 1 where is the figure and 0 is empty space!
function [X] = communication()
delete(instrfindall);
arduino = serial('COM4');
set(arduino,'DataBits',8);
set(arduino,'StopBits',1);
set(arduino,'BaudRate',9600);
set(arduino,'Parity','none');
fopen(arduino);
a=fscanf(arduino,'%s');
b=fscanf(arduino,'%s');
c=fscanf(arduino,'%s');
d=fscanf(arduino,'%s');
e=fscanf(arduino,'%s');
f=fscanf(arduino,'%s');
g=fscanf(arduino,'%s');
h=fscanf(arduino,'%s');
X=[a;b;c;d;e;f;g;h];
fclose(arduino);
Now I need Chees GUI that shows where is which figure on a chess board, does anyone can help me? I'm stuck over 10 days on it, this is my first "big" project that I'm doing alone. And I have only 4 days more to finish it :(
Thanks!

Risposte (0)

Categorie

Scopri di più su MATLAB Support Package for Arduino Hardware in Centro assistenza e File Exchange

Richiesto:

il 19 Set 2016

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by