Quote:
Originally Posted by James Lightfoot
1) Where can I find who to use the "iterative Robot" class's methods?
|
robotInit() is called when the robot first boots. <mode>Init() is called at the beginning of the given mode, and <mode>Periodic() is called every time a data packet is received from the driver station (in practice, this is every 20ms, or 50 times per second). <mode> is one of teleop, autonomous, test, or disabled.
Quote:
Originally Posted by James Lightfoot
2) Where can I see or program to map the physical I/O to things like Jaguars & ultrasonic sensors?
|
Here, under "Actuators" and "Sensors".
Quote:
Originally Posted by James Lightfoot
3) Can I use a relay output point to turn on a motor (w/ the 3 wire pig tail and the 2 power wires) or should I wire them to a PWM point and simply send it a full speed signal?
|
While it is theoretically possible, I am not sure whether that would be legal. Sending the PWM signal from software is not difficult:
Code:
motor.set(Relay.Value.kForward) // relay
motor.set(1); // PWM
Quote:
Originally Posted by James Lightfoot
4) Is there an input that will work with the PWM output of an ultrasonic sensor (300 micro-seconds to 9999 micro-seconds) or do I have to use the voltage analog output from the sensor? 
|
I don't know of any way to read a PWM signal from the cRIO. I would go with the analog signal if possible, as it's pretty simple to program:
Code:
AnalogChannel input = new AnalogChannel(<port>); // change <port> for your setup
input.getAverageVoltage(); // returns analog signal