Picking up a value from an Arduino in Matlab

2 views (last 30 days)
Philip Bald
Philip Bald on 24 Nov 2015
Commented: Galya h on 25 Nov 2015
Hi
Is anyone able to provide any help in regards how I can continuously pick up a value from the arduino and output it in Matlab?
I know you send the data via a Serial.println(GS);
I just want to know how to pick up the value for GS continuously in Matlab.
Additional Information:
I am unsure how to code a colour sensor in Matlab and have hence used an arduino. In my code I have converted a colour sensor into a grey-scale value ranging from 0-255. What I want to be able to do is receive this value continuously to Matlab. I am however unsure in the method of achieving this.
Any help would be greatly appreciated.
Thanks.
  2 Comments
Menghan
Menghan on 24 Nov 2015
Try the MATLAB Arduino Support Package that comes with base MATLAB. See the link below,
It allows you to get data from pins and also I2C and SPI buses on Arduino into MATLAB. You would need to write a loop to keep calling the MATLAB functions if multiple readings are needed in your application.
Galya h
Galya h on 25 Nov 2015
Hi, i have the same question as Philip. I tried reading the pins using the Matlab support package, but it works too slow for what i need (rotary encoder). so im still trying to find a way to get arduino to share the value of variables.

Sign in to comment.

Answers (0)

Categories

Find more on MATLAB Support Package for Arduino Hardware in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!