Jump to content
View in the app

A better way to browse. Learn more.

Tinkerunity

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

ContinuousAcceleration16BitCallback für Accelerometer Bricklet 2.0 in Matlab

Featured Replies

Geschrieben

Hallo. Kann jemand dieses Programm ändern. Ich brauche ein Programm, das jeder 0.5ms ein Beschleunigungsdata von Achse[X] zeigt. Bitte nutzen Sie  ContinuousAcceleration16BitCallback in der Sprache vom MATLAB. Vielen Dank.

 

function matlab_example_callback()
    import com.tinkerforge.IPConnection;
    import com.tinkerforge.BrickletAccelerometerV2;

    HOST = 'localhost';
    PORT = 4223;
    UID = 'XYZ'; % Change XYZ to the UID of your Accelerometer Bricklet 2.0

    ipcon = IPConnection(); % Create IP connection
    a = handle(BrickletAccelerometerV2(UID, ipcon), 'CallbackProperties'); % Create device object

    ipcon.connect(HOST, PORT); % Connect to brickd
    % Don't use device before ipcon is connected

    % Register acceleration callback to function cb_acceleration
    set(a, 'AccelerationCallback', @(h, e) cb_acceleration(e));

    % Set period for acceleration callback to 1s (1000ms)
    a.setAccelerationCallbackConfiguration(1000, false);

    input('Press key to exit\n', 's');
    ipcon.disconnect();
end

% Callback function for acceleration callback
function cb_acceleration(e)
    fprintf('Acceleration [X]: %g g\n', e.x/10000.0);
    fprintf('\n');
end

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Gast
Reply to this topic...

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.