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.
Detector.cpp
00001 #include "Detector.h" 00002 00003 00004 Detector::Detector(bool setValue): lcd(p22, p21, p23, p24, p25, p26) 00005 { 00006 for(int i = 0; i < 16; i++) 00007 detector.push_back(setValue); 00008 00009 } 00010 00011 Detector::~Detector(){ 00012 //dtor 00013 } 00014 00015 bool Detector::checkReservation(int number){ 00016 return detector.at(number); 00017 } 00018 00019 void Detector::makeReservation(vector<int> area){ 00020 00021 for(int i = 0; i<area.size(); i++){ 00022 detector.at(area.at(i)) = true; 00023 } 00024 } 00025 00026 void Detector::clearReservation(vector<int> area){ 00027 00028 for(int i = 0; i<area.size(); i++){ 00029 detector.at(area.at(i)) = false; 00030 } 00031 } 00032 void Detector::showReservation(){ 00033 lcd.printf("Res:"); 00034 for(int i = 0; i<16; i++){ 00035 if(detector.at(i)) 00036 lcd.printf("%d ", i); 00037 } 00038 }
Generated on Fri Jul 22 2022 17:31:31 by
1.7.2