Skip to content
This repository has been archived by the owner on Sep 6, 2022. It is now read-only.

Commit

Permalink
fix to hitechnic_irseeker example and Lego_Ultrasonic.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Hubert424 committed Oct 17, 2018
1 parent f3578e9 commit 30f0c4e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions examples/robocore/hitechnic_irseeker.cpp
Expand Up @@ -9,8 +9,7 @@ using namespace hSensors;
void hMain(void)
{

hLegoSensor_i2c ls(hSens1);
Hitechnic_IRSeeker sensor(ls);
Hitechnic_IRSeeker sensor(hSens1);

for (;;)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Lego_Ultrasonic.cpp
Expand Up @@ -45,7 +45,7 @@ int Lego_Ultrasonic::readDist()
init();
uint8_t tx[1], rx[1];
tx[0] = LEGOUS_REG_DATA;
if (!sens.getI2C().read(1, tx, 1, rx, 1))
if (!sens.getI2C().rw(1, tx, 1, rx, 1, 10000))
return -1;

return rx[0];
Expand All @@ -55,7 +55,7 @@ bool Lego_Ultrasonic::readDistances(uint8_t distances[8])
init();
uint8_t tx[1];
tx[0] = LEGOUS_REG_DATA;
return sens.getI2C().read(1, tx, 1, distances, 8);
return sens.getI2C().rw(1, tx, 1, distances, 8, 10000);
}
bool Lego_Ultrasonic::setSingleMode()
{
Expand Down

0 comments on commit 30f0c4e

Please sign in to comment.