Help with a timer class

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

Moderators: imaqine, 99jonathan, roger

User avatar
Advanced Member
Posts: 361
Joined: Wed Sep 13, 2006 12:16 am
Location: UK, Milton Keynes

Help with a timer class

Postby esmetaman » Thu Dec 20, 2007 12:01 am

Hi I would like to program a class using Timer to show a character in LCD. Anybody can help me?

I dont know how to use Timer class in NXJ.

Juan Antonio Breña Moral

User avatar
Site Admin
Posts: 392
Joined: Fri Aug 04, 2006 4:03 pm

Postby bbagnall » Tue Dec 25, 2007 6:30 pm

First you create a TimerListener class by extending the TimerListener interface. Implement a method called timedOut() as the interface requires. Everytime the timer clicks, this method will be called, so I assume you want to update your LCD image here.

Then make a timer object that uses your timerListener - specify the delay and your TimerListener:

Timer(int theDelay, TimerListener el)

The rest is pretty self explanatory from the API docs for Timer.

Return to “NXJ Software”

Who is online

Users browsing this forum: No registered users and 2 guests