2015-03-21 15:52:03 -03:00
|
|
|
/*
|
|
|
|
*
|
|
|
|
* Author: Rafael da Mata Neri <rafael.neri@gmail.com>
|
|
|
|
* Copyright (c) 2015 Intel Corporation.
|
|
|
|
*
|
|
|
|
*
|
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.
|
2015-03-21 15:52:03 -03:00
|
|
|
*
|
2019-07-30 19:41:32 -07:00
|
|
|
* SPDX-License-Identifier: MIT
|
2015-03-21 15:52:03 -03:00
|
|
|
*/
|
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
//! [Interesting]
|
2016-04-25 14:27:51 -07:00
|
|
|
#include "hx711.hpp"
|
2015-03-21 15:52:03 -03:00
|
|
|
|
|
|
|
int
|
2017-08-30 15:00:29 -07:00
|
|
|
main(int argc, char** argv)
|
2015-03-21 15:52:03 -03:00
|
|
|
{
|
2017-08-30 15:00:29 -07:00
|
|
|
upm::HX711 scale(3, 2);
|
2015-03-21 15:52:03 -03:00
|
|
|
|
|
|
|
// 2837: value obtained via calibration
|
2017-08-30 15:00:29 -07:00
|
|
|
scale.setScale(2837);
|
|
|
|
scale.tare();
|
|
|
|
std::cout << scale.getUnits() << std::endl;
|
2015-03-21 15:52:03 -03:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
//! [Interesting]
|