You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
1.2 KiB

/*
* Authors : Kerem Yollu & Edwin Koch
* Date : 07.03.2021
*
* Description :
* TODO : Write description or doxygene
*
*/
#include <iostream>
#include <stdint.h>
#include "./management/errorHandling.h"
#include "./management/commandManager.h"
#include "./systems/systemCall.h"
#include "./drivers/bh1750/bh1750.h"
//#include "i2c_ch1_pImpL.cpp"
#include<unistd.h>
unsigned int miliSecond = 1000;
ErrorHandler errorHandle;
CommandManager commander;
//I2C_Driver i2cDriver(1,1);
Bh1750 lightSens;
int initPlatform()
{
// Dev. Module initialisation "Ex i2c_init() ...."
return 0;
}
void dummy()
{
while(1)
{
std::cout << "value "<< lightSens.continious(BH1750_CONTINUOUS_HIGH_RES_MODE_1,1) << " Lux" <<std::endl;
usleep(150*miliSecond);
}
}
int main(int argc, char *argv[])
{
// Init
initPlatform();
std::cout << "Main" << std::endl;
//errorHandle.addNewError(-34,"Test eroor 1");
//errorHandle.handleError(-34);
//commander.addNewCommand("test", "The test command for testing the test", dummy);
//commander(argv[1]);
commander.addNewCommand("i2c", "The test command for testing the test", dummy);
commander(argv[1]);
return 1;
}