示例#1
0
	void I2CFlexel::loadLcdCustomCharacters(byte addr, byte *bitmap)
	{
		beginCommand(I2C_FLEXEL_COMMAND_LOAD_LCD_CUSTOM_CHARACTERS);
		sendCommandParameter(addr);
		sendCommandParameters(bitmap, I2C_FLEXEL_LCD_CHAR_ROWS_COUNT);
		endCommand();
	}
示例#2
0
/**
 * Sends the provided byte out over IR.
 */
void cm_send_ir(const uint8_t &data)
{
	sendByte(CmdIRChar);
	padCommand();
	sendByte(data);
	endCommand();
}
示例#3
0
/**
 * Plays the song stored under the given number.
 */
void cm_play_song(const uint8_t &song_number)
{
	sendByte(CmdPlay);
	padCommand();
	sendByte(song_number);
	endCommand();
}
示例#4
0
	void I2CFlexel::setLcdCursorPosition(byte row, byte column)
	{
		beginCommand(I2C_FLEXEL_COMMAND_SET_LCD_CURSOR_POSITION);
		sendCommandParameter(min(I2C_FLEXEL_LCD_MAX_ROWS_COUNT - 1, row));
		sendCommandParameter(min(I2C_FLEXEL_LCD_MAX_COLS_COUNT - 1, column));
		endCommand();
	}
示例#5
0
	void I2CFlexel::printStringOnLcd(const char *str, uint8_t length)
	{
		beginCommand(I2C_FLEXEL_COMMAND_PRINT_STRING_ON_LCD);
		sendCommandParameter(length);
		sendCommandParameters( (byte*) str, length);
		endCommand();
	}
示例#6
0
/**
 * Tells the robot to play the specified demo.
 *   See the DEMO_* constants for more information.
 */
void cm_play_demo(const uint8_t &demo)
{
	sendByte(CmdDemo);
	padCommand();
	sendByte(demo);
	endCommand();
}
示例#7
0
文件: Module.cpp 项目: KDE/calligra
Module::~Module()
{
    endCommand();
    qDeleteAll( d->modules );
    delete d->project;
    delete d;
}
示例#8
0
	void I2CFlexel::getTimeAndDate(byte* timeAndDate)
	{
		beginCommand(I2C_FLEXEL_COMMAND_GET_TIME_AND_DATE);
		endCommand();
		requestBytes(7);
		readBytes(timeAndDate, 7);
	}
示例#9
0
	byte I2CFlexel::getFirmwareVersion()
	{
		beginCommand(I2C_FLEXEL_COMMAND_GET_FIRMWARE_VERSION);
		endCommand();
		requestByte();
		return readByte();
	}
示例#10
0
	void I2CFlexel::setPwmForHighPowerPin(byte pin, byte pwmValue)
	{
		beginCommand(I2C_FLEXEL_COMMAND_SET_PWM_FOR_HIGH_POWER_PIN);
		sendCommandParameter(pin);
		sendCommandParameter(pwmValue);
		endCommand();
	}
示例#11
0
	void I2CFlexel::setPwmForDcMotor(byte motorAndPosition, byte pwmValue)
	{
		beginCommand(I2C_FLEXEL_COMMAND_SET_PWM_FOR_DC_MOTOR);
		sendCommandParameter(motorAndPosition);
		sendCommandParameter(pwmValue);
		endCommand();
	}
示例#12
0
	byte I2CFlexel::readKey(byte command)
	{
		beginCommand(command);
		endCommand();
		requestByte();
		return readByte();
	}
示例#13
0
	void I2CFlexel::setServoMotorPosition(byte pin, byte msb, byte lsb)
	{
		beginCommand(I2C_FLEXEL_COMMAND_SET_SERVO_MOTOR_POSITION);
		sendCommandParameter(pin);
		sendCommandParameter(msb);
		sendCommandParameter(lsb);
		endCommand();
	}
示例#14
0
	void I2CFlexel::setTime(byte sec, byte min, byte hour)
	{
		beginCommand(I2C_FLEXEL_COMMAND_SET_TIME);
		sendCommandParameter(sec);
		sendCommandParameter(min);
		sendCommandParameter(hour);
		endCommand();
	}
示例#15
0
	void I2CFlexel::getAnalogInputValue(byte pin, byte* analog)
	{
		beginCommand(I2C_FLEXEL_COMMAND_GET_ANALOG_INPUT_VALUE);
		sendCommandParameter(pin);
		endCommand();
		requestBytes(2);
		readBytes(analog, 2);
	}
示例#16
0
/**
 * Reads the strength of the wall sensor's signal.
 * The range is 0 to 4095.
 */
uint16_t cm_read_wall_signal(void)
{
	sendByte(CmdSensors);
	padCommand();
	sendByte(SEN_WALL_SIGNAL);
	endCommand();
	
	return readWord();
}
示例#17
0
/**
 * Reads the strength of the front left cliff sensor's signal.
 * The range is 0 to 4095.
 */
uint16_t cm_read_front_left_cliff_signal(void)
{
	sendByte(CmdSensors);
	padCommand();
	sendByte(SEN_FRONT_LEFT_CLIFF_SIGNAL);
	endCommand();
	
	return readWord();
}
示例#18
0
	void I2CFlexel::setDate(byte wday, byte day, byte month, byte year)
	{
		beginCommand(I2C_FLEXEL_COMMAND_SET_DATE);
		sendCommandParameter(wday);
		sendCommandParameter(day);
		sendCommandParameter(month);
		sendCommandParameter(year);
		endCommand();
	}
示例#19
0
/**
 * Reads the strength of the far right cliff sensor's signal.
 * The range is 0 to 4095.
 */
uint16_t cm_read_right_cliff_signal(void)
{
	sendByte(CmdSensors);
	padCommand();
	sendByte(SEN_FAR_RIGHT_CLIFF_SIGNAL);
	endCommand();
	
	return readWord();
}
示例#20
0
/**
 * Reads the current Open Interface mode.
 * See the OI_MODE_* codes in the cm.h header.
 */
uint8_t cm_read_oi_mode(void)
{
	sendByte(CmdSensors);
	padCommand();
	sendByte(SEN_OI_MODE);
	endCommand();
	
	return readByte();
}
示例#21
0
/**
 * Reads the battery's estimated charge capacity in milliamp-hours.
 * Note: This value is not accurate if the robot is running off Alkaline batteries.
 */
uint16_t cm_read_battery_capacity(void)
{
	sendByte(CmdSensors);
	padCommand();
	sendByte(SEN_CAPACITY);
	endCommand();
	
	return readWord();
}
示例#22
0
/**
 * Reads the number of the currently-playing song.
 * Range is 0-15.
 */
uint8_t cm_read_current_song_number(void)
{
	sendByte(CmdSensors);
	padCommand();
	sendByte(SEN_SONG_NUMBER);
	endCommand();
	
	return readByte();
}
示例#23
0
/**
 * Returns the last-requested radius.
 * Range is -32768 to 32767, units are in millimeters.
 */
uint16_t cm_read_requested_radius(void)
{
	sendByte(CmdSensors);
	padCommand();
	sendByte(SEN_RADIUS);
	endCommand();
	
	return readWord();
}
示例#24
0
/**
 * Returns 1 if there is a song currently playing.
 */
uint8_t cm_read_is_song_playing(void)
{
	sendByte(CmdSensors);
	padCommand();
	sendByte(SEN_SONG_PLAYING);
	endCommand();
	
	return readByte();
}
示例#25
0
/**
 * Reads the battery's current temperature in degrees Celsius.
 */
int8_t cm_read_battery_temperature(void)
{
	sendByte(CmdSensors);
	padCommand();
	sendByte(SEN_TEMPERATURE);
	endCommand();
	
	return readWord();
}
示例#26
0
/**
 * Reads the battery's current charge in milliamp-hours.
 * Note: This value is not accurate if the robot is running off Alkaline batteries.
 */
uint16_t cm_read_battery_charge(void)
{
	sendByte(CmdSensors);
	padCommand();
	sendByte(SEN_CHARGE);
	endCommand();
	
	return readWord();
}
示例#27
0
/**
 * Reads the battery's current voltage in millivolts.
 */
uint16_t cm_read_battery_voltage(void)
{
	sendByte(CmdSensors);
	padCommand();
	sendByte(SEN_VOLTAGE);
	endCommand();
	
	return readWord();
}
示例#28
0
/**
 * Reads the amount of current running into (positive values) or out of (negative values)
 *   the robot's battery.
 */
int16_t cm_read_battery_current(void)
{
	sendByte(CmdSensors);
	padCommand();
	sendByte(SEN_CURRENT);
	endCommand();
	
	return readWord();
}
示例#29
0
/**
 * Returns the last-requested speed for the left wheel.
 * Range is -500 to 500, in millimeters per second.
 */
uint16_t cm_read_requested_left_speed(void)
{
	sendByte(CmdSensors);
	padCommand();
	sendByte(SEN_LEFT_WHEEL_SPEED);
	endCommand();
	
	return readWord();
}
示例#30
0
/**
 * Reads the battery's current charging state.
 * See the BATTERY_* codes in the cm.h header.
 */
uint8_t cm_read_charging_state(void)
{
	sendByte(CmdSensors);
	padCommand();
	sendByte(SEN_CHARGE_STATE);
	endCommand();
	
	return readByte();
}