Jump to content

Recommended Posts

Posted

Hello all,

I have a Java code for a RCX 1.0:

>>"Please read the Java code in the jpg file in the notes"<<

post-130392-0-72201400-1417738526_thumb.jpg

I don't know how to do...

I want to program the vehicle to run not only for "Sensor.S3.readValue()==700",

but in a range from 690 to 710 straight.

How can I program with Java?

Please help me!

With best regards

sebo0005

Posted

You only have to change the three IF clauses:

Substitute

if(Sensor.S3.readValue()==700)

With

if((Sensor.S3.readValue()>=690) && (Sensor.S3.readValue()<=710))

Substitute

else if(Sensor.S3.readValue() > 700)

With

else if(Sensor.S3.readValue() > 710)

Substitute

else if(Sensor.S3.readValue() < 700)

With

else if(Sensor.S3.readValue() > 690)

Thats all!

Join the conversation

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

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...