wpi-32u4-library
Enumerations | Functions | Variables
main.cpp File Reference
#include <Arduino.h>
#include <wpi-32u4-lib.h>
#include <IRdecoder.h>
#include <ir_codes.h>
#include <Chassis.h>
#include <Servo32u4.h>

Go to the source code of this file.

Enumerations

enum  ROBOT_STATE { ROBOT_IDLE , ROBOT_SERVO_TEST }
 

Functions

void idle (void)
 
void adjustServos (uint16_t uSeconds)
 
void handleKeyPress (int16_t keyPress)
 
void setup ()
 
void loop ()
 

Variables

Chassis chassis (7.0, 1440, 14.9)
 
Servo32U4Pin5 servoA
 
Servo32U4Pin6 servoB
 
const uint8_t IR_DETECTOR_PIN = 1
 
IRDecoder decoder (IR_DETECTOR_PIN)
 
ROBOT_STATE robotState = ROBOT_IDLE
 

Enumeration Type Documentation

◆ ROBOT_STATE

Enumerator
ROBOT_IDLE 
ROBOT_SERVO_TEST 

Definition at line 31 of file main.cpp.

Function Documentation

◆ adjustServos()

void adjustServos ( uint16_t  uSeconds)

◆ handleKeyPress()

void handleKeyPress ( int16_t  keyPress)

◆ idle()

void idle ( void  )

◆ loop()

void loop ( )

Definition at line 127 of file main.cpp.

References decoder, IRDecoder::getKeyCode(), handleKeyPress(), and robotState.

◆ setup()

void setup ( )

Variable Documentation

◆ chassis

Chassis chassis(7.0, 1440, 14.9) ( 7.  0,
1440  ,
14.  9 
)

Demonstration of controlling two servos simultanesouly. See documentation for servo.h/.cpp for more details.

Referenced by idle(), and setup().

◆ decoder

Referenced by loop(), and setup().

◆ IR_DETECTOR_PIN

const uint8_t IR_DETECTOR_PIN = 1

Definition at line 27 of file main.cpp.

◆ robotState

ROBOT_STATE robotState = ROBOT_IDLE

Definition at line 32 of file main.cpp.

Referenced by adjustServos(), handleKeyPress(), idle(), and loop().

◆ servoA

Servo32U4Pin5 servoA

Definition at line 23 of file main.cpp.

Referenced by adjustServos(), handleKeyPress(), idle(), and setup().

◆ servoB

Servo32U4Pin6 servoB

Definition at line 24 of file main.cpp.

Referenced by adjustServos(), handleKeyPress(), idle(), and setup().