Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: ANSITermMenuSystem
Fork of menuSystemMbed by
console.cpp
- Committer:
- Rybowonder
- Date:
- 2013-04-16
- Revision:
- 4:1178a1905490
- Parent:
- 0:a5ece7312edc
- Child:
- 5:92389cf2106d
File content as of revision 4:1178a1905490:
// console.cpp
//
#include "console.h"
#include "SerialGraphicLCD.h" // changed from "ANISTerm.h" April 2nd 2013
using namespace std;
extern SerialGraphicLCD lcd; //Changed April 2nd 2013
//
// Clears the screen
//
void clrscr()
{
lcd.clear(); //changed from pc.clear_screen(); April 2nd 2013
}
//
// Moves the cursor to x, y in console window
// ie x=left\right y=top\bottom
//
void gotoxy(int x, int y)
{
lcd.pos(x, y); //changed from pc.set_cursor_position(x,y); April 2nd 2013
}
void printXY( char * text, int x, int y)
{
static bool runOnce = false;
if (runOnce == false){
clrscr();
runOnce = true;
}
gotoxy( x, y);
lcd.printf("%s", text); //changed from pc.printf("%s", text); April 2nd 2013
}
//
// Set text and background colors
//
void setrgb(int color)
{
switch (color)
{
case 0: // White on Black
break;
case 1: // Red on Black
break;
case 2: // Green on Black
break;
case 3: // Yellow on Black
break;
case 4: // Blue on Black
break;
case 5: // Magenta on Black
break;
case 6: // Cyan on Black
break;
case 7: // Black on Gray
break;
case 8: // Black on White
break;
case 9: // Red on White
break;
case 10: // Green on White
break;
case 11: // Yellow on White
break;
case 12: // Blue on White
break;
case 13: // Magenta on White
break;
case 14: // Cyan on White
break;
case 15: // White on White
break;
default : // White on Black
break;
}
}
