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: mbed
ScreenArray.cpp
00001 #include "ScreenArray.h" 00002 00003 //Default screenarray object constructor 00004 ScreenArray::ScreenArray() {} 00005 00006 //Default screenarray object destructor 00007 ScreenArray::~ScreenArray() {} 00008 00009 00010 //Mutator method initialises the screenarray object by filling the integer 00011 //array with zeros 00012 void ScreenArray::init(){ 00013 screen_x =48; 00014 screen_y = 84; 00015 00016 for(int i = 0; i < screen_x; i++) { 00017 for(int t = 0; t < screen_y; t++) { 00018 Screen[t][i] = 0; 00019 } 00020 } 00021 } 00022 00023 //Accessor method returns the value of the element at the array poisiton denoted 00024 //by the x and y coordinates(columns and rows value) passed as the method parameter 00025 int ScreenArray::get(int x,int y) { 00026 return Screen[y][x]; 00027 } 00028 00029 //Mutator method sets the array element at the position denoted by the x and y 00030 //coordinates(columns and rows value) to the type(integer value) passed as the 00031 //method's parameters 00032 void ScreenArray::set(int x,int y,int type){ 00033 Screen[y][x] = type; 00034 } 00035 00036 00037 //Mutator method sets all the elements within the region of elements within the 00038 //screen array to the type passed as the method parameter call 00039 void ScreenArray::setRange(int x,int y,int width,int height,int type) { 00040 00041 for(int a = x; a < (x + width); a++) { 00042 for(int b = y ; b < (y + height); b++) { 00043 Screen[b][a] = type; 00044 } 00045 } 00046 } 00047
Generated on Thu Aug 4 2022 12:05:20 by
1.7.2