2014-10-10 16:19:44 +00:00
|
|
|
/*
|
|
|
|
* Author: Nandkishor Sonar <Nandkishor.Sonar@intel.com>
|
|
|
|
* Copyright (c) 2014 Intel Corporation.
|
|
|
|
*
|
|
|
|
* LIGHT-TO-DIGITAL CONVERTER [TAOS-TSL2561]
|
|
|
|
*
|
2019-07-30 19:41:32 -07:00
|
|
|
* This program and the accompanying materials are made available under the
|
|
|
|
* terms of the The MIT License which is available at
|
|
|
|
* https://opensource.org/licenses/MIT.
|
2014-10-10 16:19:44 +00:00
|
|
|
*
|
2019-07-30 19:41:32 -07:00
|
|
|
* SPDX-License-Identifier: MIT
|
2014-10-10 16:19:44 +00:00
|
|
|
*/
|
|
|
|
|
2017-08-30 15:00:29 -07:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
2014-10-10 16:19:44 +00:00
|
|
|
|
2016-04-25 14:27:51 -07:00
|
|
|
#include "tsl2561.hpp"
|
2014-10-10 16:19:44 +00:00
|
|
|
|
2017-08-30 15:00:29 -07:00
|
|
|
int
|
|
|
|
main(int argc, char** argv)
|
2014-10-10 16:19:44 +00:00
|
|
|
{
|
2014-11-12 15:19:17 +00:00
|
|
|
int loopCount = 100;
|
2014-10-10 16:19:44 +00:00
|
|
|
|
2017-08-30 15:00:29 -07:00
|
|
|
//! [Interesting]
|
2014-11-12 15:19:17 +00:00
|
|
|
if (argc < 2) {
|
2014-10-10 16:19:44 +00:00
|
|
|
printf("Provide loop count \n");
|
|
|
|
} else {
|
|
|
|
loopCount = atoi(argv[1]);
|
|
|
|
}
|
2017-08-30 15:00:29 -07:00
|
|
|
upm::TSL2561 sensor;
|
2014-10-10 16:19:44 +00:00
|
|
|
|
2017-08-30 15:00:29 -07:00
|
|
|
for (int i = 0; i < loopCount; i++) {
|
|
|
|
fprintf(stdout, "Lux = %d\n", sensor.getLux());
|
2014-10-10 16:19:44 +00:00
|
|
|
}
|
|
|
|
|
2017-08-30 15:00:29 -07:00
|
|
|
//! [Interesting]
|
2014-10-10 16:19:44 +00:00
|
|
|
|
|
|
|
return (0);
|
|
|
|
}
|