Add the daqtoolbox and mgl directories of NIMH ML to the MATLAB path, to call the command-line functions without running NIMH ML.
id = BlackrockLED_init; % This id is required to use the other functions
BlackrockLED_shot(id, intensity); % change intensity immediately
BlackrockLED_load(id, intensity, duration); % load an intensity pattern without changing output yet
BlackrockLED_play(id); % apply the pattern all at once
BlackrockLED_clear(id); % turn off all LEDs
temperature = BlackrockLED_temp(id); % get temperature readings
temperature = BlackrockLED_temp(id, ver); % ver - 1: pogo pins, 2: Omnetics connectors (default)
BlackrockLED_setmax(id, max_intensity); % change the max settable intensity (0.5, by default)
intensity must be between 0 (off) and 1 (maximum current) and can be in any of the following formats.
duration is in milliseconds and must be a multiple of 2.
Condition | Frequency | Block | Timing File | TaskObject#1 |
1 | 1 | 1 | LED_taskobj | gen(BlackrockLED_taskobj) |
id = TaskObject(1).ID; % TaskObject#1
BlackrockLED_setmax(id, 0.005); % change the maximum allowed intensity for safety
BlackrockLED_load(id, 0.005, 500);
toggleobject(1);
idle(500);
dashboard(1, sprintf('LED temperature: %4.1f %4.1f %4.1f %4.1f' , BlackrockLED_temp(id)));
idle(500);
led = BlackrockLED(null_); % led.ID is the id, but you rarely need it in the scene framework
led.MaxIntensity = 0.005; % or led.setmax(intensity);
led.load(0.005, 500); % led.load(intensity, duration);
tc = TimeCounter(led);
tc.Duration = 500;
scene = create_scene(tc);
run_scene(scene);
dashboard(1, sprintf('LED temperature: %4.1f %4.1f %4.1f %4.1f' , led.Temperature)); % or
led.temp(2);
idle(500);