/// <summary> /// Robot Constructor: initilizes variables /// </summary> /// <param name="teamID">Team ID</param> /// <param name="radioComPort">Radio Com Port</param> public Robot(string teamID, String radioComPort) { actuators = new ArrayList(); sensors = new ArrayList(); ports = new ArrayList(); canMove = true; I2CDevice.Configuration conA = new I2CDevice.Configuration(0x0A, 100); i2c = new I2CDevice(conA); isAutonomous = false; this.teamID = teamID; radio = new Radio_Series1(this, radioComPort); shiftBrite = new A6281.Single(Cpu.Pin.GPIO_NONE, (Cpu.Pin)FEZ_Pin.Digital.Di9, (Cpu.Pin)FEZ_Pin.Digital.Di10, SPI.SPI_module.SPI1); shiftBrite.On = true; shiftBriteTimer = 0; shiftBrite.SetColorImmediate(700, 700, 700); heartbeatTimer = DateTime.Now.Ticks; // Set the team color for the shiftBrite // Still to be implemented in 0.1c // Make a deep copy of the UI values so they don't change mid-update UIAnalogVals = (int[])radio.UIAnalogVals.Clone(); UIDigitalVals = (bool[])radio.UIDigitalVals.Clone(); }
public ShiftBriteHandler() { shiftbrite = new A6281.Single(Pins.GPIO_NONE, Pins.GPIO_PIN_D9, Pins.GPIO_PIN_D10, SPI.SPI_module.SPI1); shiftbrite.On = false; }
/// <summary> /// Robot Constructor: initilizes variables /// </summary> /// <param name="teamID">Team ID</param> /// <param name="radioComPort">Radio Com Port</param> public Robot(string teamID, String radioComPort) { actuators = new ArrayList(); sensors = new ArrayList(); ports = new ArrayList(); canMove = true; isAutonomous = false; this.teamID = teamID; radio = new Radio_Series1(this, radioComPort); shiftBrite = new A6281.Single(Cpu.Pin.GPIO_NONE, (Cpu.Pin)FEZ_Pin.Digital.Di9, (Cpu.Pin)FEZ_Pin.Digital.Di10, SPI.SPI_module.SPI1); previousTime = 0; // Set the team color for the shiftBrite // Still to be implemented in 0.1c if (true) { shiftBrite.SetColorImmediate(650, 350, 0); } else { shiftBrite.SetColorImmediate(0, 0, 500); } // Make a deep copy of the UI values so they don't change mid-update UIAnalogVals = (int[])radio.UIAnalogVals.Clone(); UIDigitalVals = (bool[])radio.UIDigitalVals.Clone(); }