Tinker Posted October 4, 2017 at 10:30 PM Share Posted October 4, 2017 at 10:30 PM Hello, I am using Ambient Light Bricklet(V2) with MatLab. I would like to know how to get the vector data of sensor values from callback function. Because, I want to plot this data with other sensors(Temperature and Pressure). function matlab_example_callback() import com.tinkerforge.IPConnection; import com.tinkerforge.BrickletAmbientLightV2; HOST = 'localhost'; PORT = 4223; UID = 'XYZ'; ipcon = IPConnection(); al = handle(BrickletAmbientLightV2(UID, ipcon), 'CallbackProperties'); ipcon.connect(HOST, PORT); set(al, 'IlluminanceCallback', @(h, e) cb_illuminance(e)); al.setIlluminanceCallbackPeriod(1000); input('Press key to exit\n', 's'); ipcon.disconnect(); end function cb_illuminance(e) fprintf('Illuminance: %g Lux\n', e.illuminance/100.0); end Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.