|Check if a sensor or motor is connected
|Page 1 of 1|
|Author:||Valter1966 [ Tue Sep 04, 2018 7:55 am ]|
|Post subject:||Check if a sensor or motor is connected|
my Team needs to check (before the start of the sumo match), if all the sensor and motor cables are connected.
It is possible to do this with RobotC.
We use EV3 and NXT.
|Author:||jkandra [ Thu Sep 06, 2018 11:18 am ]|
|Post subject:||Re: Check if a sensor or motor is connected|
Here are two functions. The first is a 'task' which can be started in your main Task using the following:
startTask(portMonitor); // Make sure there is something in every port
As a 'task', the portMonitor function will run continuously while your main task is running. This is a multi-threaded program. In this task, all ports must be connected to something. If a cable gets accidently un-plugged, the robot will sound an alarm notifying the user that something has been unplugged.
The second function checkPort() allows you to pass a port # and a sensor type as parameters and the robot will check to see if that port has the sensor.
|Page 1 of 1||All times are UTC - 5 hours [ DST ]|
|Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group