Skip to content

Commit a677e7c

Browse files
committed
changes made to support sparkfun toolkit v1.0, and moved to the current style of code layout
1 parent 502bdd2 commit a677e7c

File tree

5 files changed

+238
-186
lines changed

5 files changed

+238
-186
lines changed

examples/Example8_SelfTest/Example8_SelfTest.ino

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
SPDX-License-Identifier: MIT
3-
3+
44
Copyright (c) 2024 SparkFun Electronics
55
*/
66

@@ -41,10 +41,10 @@ void setup()
4141
Serial.println("The OTOS must be stationary during the self test!");
4242

4343
// Perform the self test
44-
sfeTkError_t result = myOtos.selfTest();
45-
44+
sfTkError_t result = myOtos.selfTest();
45+
4646
// Check if the self test passed
47-
if(result == kSTkErrOk)
47+
if (result == ksfTkErrOk)
4848
{
4949
Serial.println("Self test passed!");
5050
}

library.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
name=SparkFun Qwiic OTOS Arduino Library
2-
version=1.0.2
2+
version=1.1.0
33
author=SparkFun Electronics <techsupport@sparkfun.com>
44
maintainer=SparkFun Electronics <sparkfun.com>
55
sentence=A library to use the SparkFun Qwiic Optical Tracking Odometry Sensor
6-
paragraph=
6+
paragraph=The SparkFun Qwiic Optical Tracking Odometry Sensor empowers you to elevate a robots navigation capabilities with precision and streamlined integration.
77
category=Sensors
88
url=https://github.com/sparkfun/SparkFun_Qwiic_OTOS_Arduino_Library
99
architectures=*
10-
depends=SparkFun Toolkit (<1.0.0)
10+
depends=SparkFun Toolkit (>=1.0.0)
Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,27 @@
1-
/*
2-
SPDX-License-Identifier: MIT
3-
4-
Copyright (c) 2024 SparkFun Electronics
5-
*/
1+
/**
2+
* @file SparkFun_Qwiic_OTOS_Arduino_Library.h
3+
* @brief Arduino wrapper for the SparkFun Qwiic OTOS sensor driver
4+
* @details This file provides an Arduino-compatible interface to the SparkFun Qwiic
5+
* Optical Tracking Odometry Sensor (OTOS). It wraps the platform-agnostic
6+
* C++ driver to provide familiar Arduino conventions and simplified usage.
7+
*
8+
* Features:
9+
* - Simple Arduino-style begin() function
10+
* - Default Wire interface support
11+
* - Compatible with all Arduino platforms
12+
* - Inherits all functionality from base C++ driver
13+
* - Automatic I2C bus configuration
14+
*
15+
* @author SparkFun Electronics
16+
* @date February 2024
17+
* @copyright Copyright (c) 2024-2025, SparkFun Electronics Inc.
18+
*
19+
* SPDX-License-Identifier: MIT
20+
*
21+
* @see https://github.com/sparkfun/SparkFun_Qwiic_OTOS_Arduino_Library
22+
*/
23+
24+
// ...existing code...
625

726
/*******************************************************************************
827
SparkFun_Qwiic_OTOS_Arduino_Library.h - Arduino wrapper of the C++ driver
@@ -13,14 +32,16 @@
1332
*******************************************************************************/
1433

1534
#pragma once
16-
35+
// clang-format off
1736
#include "Arduino.h"
18-
#include "sfeQwiicOtos.h"
37+
#include <SparkFun_Toolkit.h>
38+
#include "sfTk/sfDevOTOS.h"
1939
#include <Wire.h>
40+
// clang-format on
2041

2142
/// @brief Arduino class for the SparkFun Qwiic Optical Tracking Odometry Sensor
2243
/// (OTOS)
23-
class QwiicOTOS : public sfeQwiicOtos
44+
class QwiicOTOS : public sfDevOTOS
2445
{
2546
public:
2647
/// @brief Begins the Qwiic OTOS and verifies it is connected
@@ -32,7 +53,7 @@ class QwiicOTOS : public sfeQwiicOtos
3253
_theI2CBus.init(wirePort, kDefaultAddress);
3354

3455
// Begin the sensor
35-
return sfeQwiicOtos::begin(&_theI2CBus) == kSTkErrOk;
56+
return sfDevOTOS::begin(&_theI2CBus) == ksfTkErrOk;
3657
}
3758

3859
protected:
@@ -42,5 +63,5 @@ class QwiicOTOS : public sfeQwiicOtos
4263
}
4364

4465
private:
45-
sfeTkArdI2C _theI2CBus;
66+
sfTkArdI2C _theI2CBus;
4667
};

0 commit comments

Comments
 (0)