|
Re: CRIO ARDUINO INTERFACE
here is a rough idea of the constructor
Code:
public void robotInit() {
Arduino arduinoEx = new Arduino(CommsMode commsMode,int inChannel, int outChannel);
Arduino arduinoAn = new Arduino(CommsMode.kAnalog, 1); //Analog, channel 1
Arduino arduinoDig = new Arduino(CommsMode.kDigital, 7, 8); //Digital, Channels 7 and 8
Arduino arduinoSer = new Arduino(CommsMode.kSerial, baudRate); //Serial, baudRate
Arduino arduinoI2C = new Arduino(CommsMode.kI2C, 1);
}
ControlMode - Analog(with a digital Pot), Digital(with the DIO pins of the crio and arduino), Serial, I2C, etc
int inChannel - Digital-the recieving pin
Analog-The input pin
Serial-Not Needed
I2C-The address on the bus
int OutChannel-Digital only- the sending pin
long BaudRate - Serial Only, self explanatory
I'll write something up in the library to show you how the constructors would work
__________________
Drive Coach Team 5012 Gryffingear / Antelope Valley FIRST teams / EWCP - (2013 - Current)
Student / Driver / Programmer / CAD - FRC Team 399: Eagle Robotics / FTC Team 72: GarageBots - (2009 - 2013)
Los Angeles Region FTC FTA/CSA/Head Ref
[FF] FIRST Pick
2014 FTC Los Angeles Regional Compass Award Winner.
2017 - Sacramento Regional / Las Vegas Regional
2016 - Los Angeles Regional Creativity + Winners (1197, 987, 5012) / Las Vegas Regional Team Spirit + SF (5012, 5851, 5049) / Galileo Subdivision
2015 - Inland Empire QF (597, 5012, 4413) / Las Vegas Imagery + Winners (148, 987, 5012) / Newton Subdivision and World Champions (118, 1678, 1671, 5012)
2014 - Inland Empire Rookie All Star + Highest Rookie Seed + SF (2339, 1967, 5012) / Las Vegas Rookie All Star / Galileo Division Imagery
Last edited by Jeremy Germita : 05-28-2010 at 10:27 PM.
|