Skip to content
Snippets Groups Projects
Select Git revision
  • issue-motorStartBug
  • master default protected
  • dev_2022
  • patch-1
  • develop
  • 50-use-ubuntus-libhidapi
  • issue-highLevelDispatch
  • issue-highLevelDesign
  • issue-commandLayerDesign
  • v1.0
  • v0.4-rc.13
  • v0.4-rc.12
  • v0.4-rc.11
  • v0.4-rc.10
  • v0.4-rc.9
  • v0.3-rc.8
  • v0.3-rc.7
  • v0.3-rc.6
  • v0.3-rc.5
  • v0.3-rc.4
  • v0.3-rc.3
  • v0.3-rc.2
  • v0.3-rc.1
  • v0.3-rc
  • v0.2
  • v0.1.1
  • v0.1
27 results

sensorProblemLowLevel.m

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    sensorProblemLowLevel.m 757 B
    % This function requires:
    %   * Brick connected via USB
    %   * EV3-Touch-Sensor at port 1
    clear all;
    
    b = CommunicationInterface('usb');
    b.debug = 0; % Set this to 1 to have all packets sent and received printed to the console
    
    % If you call this script more than once in a row, the reply to this command will also be
    % erroneous (as this is another implicit mode change, from Bumps to Pushed).
    val = b.inputReadSI(0, SensorPort.Sensor1, DeviceMode.Touch.Pushed);
    fprintf('Pushed: %d\n', val);
    
    val = b.inputReadSI(0, SensorPort.Sensor1, DeviceMode.Touch.Bumps); % The reply to this command should be erroneous 
    fprintf('Bumps: %d\n', val);
    val = b.inputReadSI(0, SensorPort.Sensor1, DeviceMode.Touch.Bumps); % Now it should work
    fprintf('Bumps: %d\n', val);