Background counter

This is where you talk about the EV3 software itself, installation issues, and programming talk.

Moderators: roger, gloomyandy, skoehler

New User
Posts: 14
Joined: Thu Sep 25, 2014 6:50 pm

Background counter

Postby fdd2001 » Fri Feb 13, 2015 5:32 pm

Hi! I need something to count in the background - just something that adds one to a variable every millisecond. How can I do this?
Background: Idea is: Line following, robot loses line, if robot can't find line for a said number of seconds, steer back and drive forward.

Thanks in advance!

User avatar
leJOS Team Member
Posts: 6001
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: Background counter

Postby gloomyandy » Fri Feb 13, 2015 6:51 pm

Please do not post general questions about leJOS in the development forum. I have moved your question to a more appropriate section. If all you want to do is find out what the current time is (from which you can work out how long your robot has been away from the line) then just use the standard Java method: ... imeMillis()

Return to “EV3 Software”

Who is online

Users browsing this forum: No registered users and 3 guests