Skip to content

Commit

Permalink
library update
Browse files Browse the repository at this point in the history
  • Loading branch information
pim12345 committed Jul 1, 2020
1 parent a6d584f commit a99c80b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
1 change: 0 additions & 1 deletion library_code/hx711.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ void hx711::calibration_set(){
read_no_calibration(); // first value is wird so this is othwise the calibartion is off.
for (int i=1; i<=100; i++){
sum += read_no_calibration();
hwlib::cout << sum << hwlib::endl;
}
int avg_no_calibration = (sum / 100);
avg_no_calibration *= -1; // will make the number positive.
Expand Down
13 changes: 8 additions & 5 deletions test/main.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
#define CATCH_CONFIG_MAIN
#include "catch.hpp"
#include "../library_code/hx711.hpp"
#include "hwlib.hpp"



//TEST_CASE("beschrijving"){
// vector v(2);
// v = v + 4;
// REQUIRE( v == vector( 6 ) );
//}
TEST_CASE("gain check"){
//auto SCK = hwlib::target::pin_out( hwlib::target::pins::d10 );
//auto DT = hwlib::target::pin_in( hwlib::pins::d6 );
auto weegschaal = hx711(SCK, DT, 1, 20.64282166);
int gain = hx711::get_gain();
REQUIRE( gain == 2 );
}

0 comments on commit a99c80b

Please sign in to comment.