Navigation

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    1. Home
    2. Leena
    Leena

    Leena

    @Leena

    1
    Reputation
    1
    Posts
    215
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    • Profile
    • More
      • Following
      • Followers
      • Topics
      • Posts
      • Best
      • Groups
    Leena Follow

    Posts made by Leena

    Aceinna sensor integration with MATLAB

    I am trying to read sensor data directly through MATLAB code. When I use OpenIMU monitor to do the same, it reads data correctly.
    But with MATLAB, even after a successfuk serial connection establishment, it is unable to receive any bytes.
    I would like your advice about it, if I am doing something wrong.

    delete(instrfind({'Port'},{'COM3'}));
    
    % Open serial connection to Aceinna sensor
    s = serial('COM3');
    set(s,'BaudRate',115200);
    fopen(s);
    
    % Read in binary data from sensor
    % data = fread(s, s.BytesAvailable);
    
    % Check the number of bytes available before reading
    bytesAvailable = get(s, 'BytesAvailable');
    if (bytesAvailable > 0)
       data = fread(s, bytesAvailable);
    else
       disp('No data available')
    end
    
    posted in General Discussion •