Download Print this page

NEX ROBOTICS Fire Bird V ATMEGA2560 Software Manual page 62

Robotic research platform
Hide thumbs Also See for Fire Bird V ATMEGA2560:

Advertisement

NEX Robotics
void
turn_on_ir_proxi_sensors (void)
{
PORTH = PORTH & 0xF7;
}
void
turn_off_ir_proxi_sensors (void)
{
PORTH = PORTH | 0x08;
}
void
turn_on_all_proxy_sensors (void)
// turn on Sharp 2, 3, 4, red LED of the white line sensors, Sharp 1, 5 and IR proximity sensor
{
PORTH = PORTH & 0xF3; //set PORTH 3 and PORTH 1 pins to 0
PORTG = PORTG & 0xFB; //set PORTG 2 pin to 0
}
void
turn_off_all_proxy_sensors (void)
// turn off Sharp 2, 3, 4, red LED of the white line sensors Sharp 1, 5 and IR proximity sensor
{
PORTH = PORTH | 0x0C; //set PORTH 3 and PORTH 1 pins to 1
PORTG = PORTG | 0x04; //set PORTG 2 pin to 1
}
3.6.6 Functions for configuring Position encoder pins
3.6.6.1 left_encoder_pin_config()
//Function to configure INT4 (PORTE 4) pin as input for the left position encoder
void
left_encoder_pin_config (void)
{
DDRE = DDRE & 0xEF;
PORTE = PORTE | 0x10;
}
3.6.6.2 right_encoder_pin_config()
//Function to configure INT5 (PORTE 5) pin as input for the right position encoder
void
right_encoder_pin_config (void)
{
DDRE = DDRE & 0xDF;
PORTE = PORTE | 0x20;
}
3.6.7 Functions for configuring servo motor control pins
3.6.7.1 servo1_pin_config();
//Configure PORTB 5 pin for servo motor 1 operation
void
servo1_pin_config (void)
{
DDRB = DDRB | 0x20;
PORTB = PORTB | 0x20;
}
www.nex-robotics.com
//turn on IR Proximity sensors
//turn off IR Proximity sensors
//Set the direction of the PORTE 4 pin as input
//Enable internal pull-up for PORTE 4 pin
//Set the direction of the PORTE 4 pin as input
//Enable internal pull-up for PORTE 4 pin
//making PORTB 5 pin output
//setting PORTB 5 pin to logic 1
Fire Bird V Software Manual
62

Advertisement

loading
Need help?

Need help?

Do you have a question about the Fire Bird V ATMEGA2560 and is the answer not in the manual?

Subscribe to Our Youtube Channel