Results 1 to 2 of 2
Thread: TINI Board
- 07-03-2010, 11:17 AM #1
Member
- Join Date
- Jul 2010
- Posts
- 2
- Rep Power
- 0
TINI Board
Hello Everyone
I am a uni student doing a project with a team and we are controlling a robotic arm using a "TINI Board" which is a 10 year old peice of gadgetry which hosts a web server, and using java applets, one can control the outputs (in this case LEDS) using java.
I am an absolute novice with java and thought i might pick some of your brains.
Basically, i need the following code to excecute the following, it turns on a yellow LED, which i am taking the output to control a relay and do various things...
manip.add(LEDManip.Y1);
lcdmanip.clear();
lcdmanip.out.println("Current Move:");
lcdmanip.out.print("Elbow Down");
lcdmanip.out.flush();
pause(5000);
In the following code
-------------------------------------------------------------------------------
import com.dalsemi.system.*;
import java.net.*;
import java.io.*;
import com.taylec.tini.*;
import com.taylec.tini.io.*;
import java.lang.*;
import java.util.*;
import com.dalsemi.system.TINIOS;
import java.util.Enumeration;
public class elbowdown
{
/**
* Pause
*/
private static final void pause(int delay_)
{
try
{
Thread.sleep(delay_);
}
catch (InterruptedException e_)
{
}
}
public static void testLED(Interrupt interrupt_)
{
try
{
LEDManip manip = new LEDManip();
LCDManipFormat lcdmanip = new LCDManipFormat();
//setup local variable to use for state manipulation of LEDs
int cur_state = 0;
//turn off the LEDs
manip.clear();
manip.add(LEDManip.Y1);
lcdmanip.clear();
lcdmanip.out.println("Current Move:");
lcdmanip.out.print("Elbow Down");
lcdmanip.out.flush();
pause(5000);
manip.subtract(LEDManip.Outer);
while(true)
{ manip.subtract(LEDManip.Inner);
if (interrupt_.getNumEvents()>0)
{
return;
}
}
}
catch (IllegalAddressException err_)
{
System.out.println(err_.toString());
}
}
public static void main(String args[])
{
Interrupt interrupt = new Interrupt();
System.out.println("Starting Motion");
testLED(interrupt);
System.out.println("Ending Motion");
System.exit(0);
}
}
----------------------------------------------------------------------------------
When i run that code, the program continues to run and stuffs up the next one from running, so i need it to exit without having to use the interupt (a button on the TINI board)
I thought it would be logical and just have the import part, then the function definition, then the LED control part, then the function stops, however when trying to remove bits, i keep getting errors.
Probably super simple, but i dont need to learn Java for my subject, just get this working...
Any help is appreciated
- 07-03-2010, 12:52 PM #2
Similar Threads
-
how can I draw a board in 2d array?
By java_fun2007 in forum New To JavaReplies: 8Last Post: 12-28-2011, 05:58 PM -
How to do a score board?
By vlan in forum Java AppletsReplies: 11Last Post: 06-03-2010, 10:10 AM -
game board design
By tomitu in forum New To JavaReplies: 12Last Post: 02-27-2010, 05:31 PM -
how to create board in java...
By zenith in forum New To JavaReplies: 5Last Post: 01-20-2010, 04:42 AM -
Programming a Board Game
By makanti in forum New To JavaReplies: 7Last Post: 03-10-2009, 02:32 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks