14#ifndef VEX_BRAIN_CLASS_H
15#define VEX_BRAIN_CLASS_H
27 static int32_t _index;
37 enum class tEventType {
39 EVENT_UP_RELEASED = 2,
40 EVENT_DOWN_PRESSED = 4,
41 EVENT_DOWN_RELEASED = 8,
42 EVENT_CHECK_PRESSED = 16,
43 EVENT_CHECK_RELEASED = 32
56 button(
const int id ) : _id(
id ) {};
110 bool _aspect_compensation;
115 int32_t rowToPixel( int32_t
row );
116 int32_t colToPixel( int32_t col );
117 int32_t scaley( int32_t y );
180 void print(
const char *format, ... );
181 void print(
char *format, ... );
192 void printAt( int32_t x, int32_t y,
const char *format, ... );
276 void drawCircle(
int x,
int y,
int radius, colorType color );
329 uint16_t
capacity( percentUnits units = percentUnits::pct );
336 double voltage( voltageUnits units = voltageUnits::volt );
370 void playNote( int32_t octave, int32_t note, int32_t ms );
Use the battery class to see information about the battery.
double voltage(voltageUnits units=voltageUnits::volt)
Gets the battery voltage.
uint16_t capacity(percentUnits units=percentUnits::pct)
Gets the battery capacity.
Use this class to write or draw to the brain's LCD screen.
void drawCircle(int x, int y, int radius, colorType color)
Draws a circle using the specified points and attributes set in the parameters. Fills the circle with...
void setAspectCompensation(bool value)
compensate for non square pixels when drawing
void setFillColor(colorType color)
Sets the default fill color for any subsequent draw command.
void drawRectangle(int x, int y, int width, int height)
Draws a rectangle using the specified points and attributes set in the parameters....
void invertCircle(int x, int y, int radius)
Inverts a circular area of the screen using the specified points and attributes set in the parameters...
void printAt(int32_t x, int32_t y, const char *format,...)
Prints a number, string, or Boolean at an x, y cursor location.
void clearScreen(void)
Clears the whole Screen to white.
void setOrigin(int32_t x, int32_t y)
Sets the origin of the screen to the parameters defined in the function.
void setPenColor(colorType color)
Sets the color of the pen to a specified color.
void setCursor(int32_t row, int32_t col)
Sets the cursor to the row and column number set in the parameters.
void drawRectangle(int x, int y, int width, int height, colorType color)
Draws a rectangle using the specified points and attributes set in the parameters....
void newLine(void)
Clears the rest of the line from where the cursor is located and then moves the cursor to the beginni...
void invertRectangle(int x, int y, int width, int height)
Inverts a rectangular area of the screen using the specified points and attributes set in the paramet...
int32_t row()
An integer that tracks the current cursor position's row, starting at 1.
void print(const char *format,...)
Prints a number, string, or Boolean.
void drawCircle(int x, int y, int radius)
Draws a circle using the specified points and attributes set in the parameters. Fills the circle with...
void clearLine(void)
Clears the rest of the line from where the cursor is located.
void clearLine(int number)
Clears the specified line.
void drawLine(int x1, int y1, int x2, int y2)
Draws a line connecting the two specified points in the parameters.
int32_t column()
An integer that tracks the current cursor position's column, starting at 1.
void drawPixel(int x, int y)
Draws a single pixel to the screen in the specified x and y location.
void setPenWidth(uint32_t width)
Sets the pen's width.
Use the terminal class to send text to the brain USB port.
void print(const char *fmt,...)
print on the vexcode terminal
button buttonCheck
A button that represents the Check button on the brain.
void setTimer(double value, timeUnits units)
Sets the timer to a value and time unit.
brain()
Creates a new brain object.
vex::timer Timer
Use the Timer class to obtain the system time.
lcd Screen
Use the Screen class to write or draw to the screen.
void playNote(int32_t octave, int32_t note, int32_t ms)
play a note in the given octave on the brain and wait for the given time before returning
void resetTimer()
Resets the timer to zero.
button buttonDown
A button that represents the Down/Right button on the brain.
double timer(timeUnits units)
Gets the value of the timer in the units specified.
button buttonUp
A button that represents the Up/Left button on the brain.
void soundOff(void)
turn sound off on the brain
void programStop()
request that vexos stop the running program. The program will stop after approximately 500mS.
void playNote(int32_t octave, int32_t note)
play a note in the given octave on the brain
void playSound(soundType sound)
play one of the predefined sounds on the brain
Use the timer class to create timers for your program.
Bumper switch device class