mirror of
				https://github.com/eclipse/upm.git
				synced 2025-10-31 23:24:20 +03:00 
			
		
		
		
	Removed using namespaces from interface examples
Signed-off-by: Serban Waltter <serban.waltter@rinftech.com>
This commit is contained in:
		| @@ -5,18 +5,18 @@ | ||||
| #include "bh1750.hpp" | ||||
| #include "max44009.hpp" | ||||
|  | ||||
| using namespace std; | ||||
| using namespace upm; | ||||
| // using namespace std; | ||||
| // using namespace upm; | ||||
|  | ||||
| int | ||||
| main() | ||||
| { | ||||
|   list<iLight*> lightSensors; | ||||
|   std::list<upm::iLight*> lightSensors; | ||||
|  | ||||
|   // Populate list of light sensors | ||||
|   lightSensors.push_back(new APDS9002(0)); | ||||
|   lightSensors.push_back(new BH1750()); | ||||
|   lightSensors.push_back(new MAX44009(1)); | ||||
|   lightSensors.push_back(new upm::APDS9002(0)); | ||||
|   lightSensors.push_back(new upm::BH1750()); | ||||
|   lightSensors.push_back(new upm::MAX44009(1)); | ||||
|  | ||||
|   // Measure luminance level from all 3 individual sensors | ||||
|   for (auto& sensor : lightSensors) { | ||||
|   | ||||
| @@ -4,18 +4,18 @@ | ||||
| #include "lm35.hpp" | ||||
| #include "abp.hpp" | ||||
|  | ||||
| using namespace std; | ||||
| using namespace upm; | ||||
| // using namespace std; | ||||
| // using namespace upm; | ||||
|  | ||||
| int | ||||
| main() | ||||
| { | ||||
|   vector<iTemperature*> tempSensors {new LM35(0), new ABP(0, ABP_DEFAULT_ADDRESS)}; | ||||
|   std::vector<upm::iTemperature*> tempSensors {new upm::LM35(0), new upm::ABP(0, ABP_DEFAULT_ADDRESS)}; | ||||
|  | ||||
|   for (auto& sensor : tempSensors) { | ||||
|     float celsiusTemp = sensor->getTemperature(); | ||||
|     cout << "Temperature in Celsius degrees: " << celsiusTemp << endl; | ||||
|     cout << "Temperature in Kelvin: " << iTemperature::convertCelsiusTo(celsiusTemp, TemperatureUnit::KELVIN); | ||||
|     std::cout << "Temperature in Celsius degrees: " << celsiusTemp << std::endl; | ||||
|     std::cout << "Temperature in Kelvin: " << upm::iTemperature::convertCelsiusTo(celsiusTemp, upm::TemperatureUnit::KELVIN) << std::endl; | ||||
|   } | ||||
|  | ||||
|   for (auto& sensor : tempSensors) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Serban Waltter
					Serban Waltter