c++ help

Soldato
Joined
9 May 2005
Posts
4,530
Location
Nottingham
I'm doing a bit of microcontroller programming which uses c++ and I'm having trouble understanding what a certain pice of code is doing.

It's not important what the code is doing but it's to control an 2x16 character LCD display, the command() function sends an opcode to the display. 0x80 tells the display controller to write to it's internal RAM so it is required before issuing another command. I'm confused by the vertical bar in the red highlighted code below, what does it mean in the context it appears in?

Code:
void LiquidCrystal::setCursor(int col, int row)
{
  int row_offsets[] = { 0x00, 0x40, 0x14, 0x54 };
  [COLOR="Red"]command(0x80 | (col + row_offsets[row]));[/COLOR]
}

void command(uint8_t);
 
Back
Top Bottom