Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

LeJOS compatibility > LocalEV3-Class not available #524

Closed
@abaumgart

Description

@abaumgart

After transferring the following source code from LeJOS to ev3dev the LocalEV3-Class is not compatible.

packagecolorSensor;importev3dev.actuators.lego.motors.EV3LargeRegulatedMotor;importev3dev.sensors.ev3.EV3ColorSensor;importlejos.hardware.Key;importlejos.hardware.port.MotorPort;importlejos.hardware.port.SensorPort;importlejos.utility.Delay;publicclassEv3devColorSensorRedMode {publicstaticvoidmain(String[]args) {EV3ColorSensorcolorSensor =newEV3ColorSensor(SensorPort.S1);colorSensor.setCurrentMode("Red");float[]sample =newfloat[colorSensor.sampleSize()];/* HERE */Keyesc =LocalEV3.get().getKey("Escape");/* HERE */EV3LargeRegulatedMotormotor =newEV3LargeRegulatedMotor(MotorPort.A);motor.setSpeed(80);while (esc.isUp()) {colorSensor.fetchSample(sample,0);System.out.println(sample[0]);if (sample[0] >0.5) {motor.stop();            }else {motor.forward();            }Delay.msDelay(1000);        }motor.close();    }}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp