Skip to content

changes made to support sparkfun toolkit v1.0, #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions examples/Example8_SelfTest/Example8_SelfTest.ino
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
SPDX-License-Identifier: MIT

Copyright (c) 2024 SparkFun Electronics
*/

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

// Perform the self test
sfeTkError_t result = myOtos.selfTest();
sfTkError_t result = myOtos.selfTest();

// Check if the self test passed
if(result == kSTkErrOk)
if (result == ksfTkErrOk)
{
Serial.println("Self test passed!");
}
Expand Down
6 changes: 3 additions & 3 deletions library.properties
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name=SparkFun Qwiic OTOS Arduino Library
version=1.0.2
version=1.1.0
author=SparkFun Electronics <[email protected]>
maintainer=SparkFun Electronics <sparkfun.com>
sentence=A library to use the SparkFun Qwiic Optical Tracking Odometry Sensor
paragraph=
paragraph=The SparkFun Qwiic Optical Tracking Odometry Sensor empowers you to elevate a robots navigation capabilities with precision and streamlined integration.
category=Sensors
url=https://github.com/sparkfun/SparkFun_Qwiic_OTOS_Arduino_Library
architectures=*
depends=SparkFun Toolkit (<1.0.0)
depends=SparkFun Toolkit (>=1.0.0)
41 changes: 31 additions & 10 deletions src/SparkFun_Qwiic_OTOS_Arduino_Library.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,27 @@
/*
SPDX-License-Identifier: MIT

Copyright (c) 2024 SparkFun Electronics
*/
/**
* @file SparkFun_Qwiic_OTOS_Arduino_Library.h
* @brief Arduino wrapper for the SparkFun Qwiic OTOS sensor driver
* @details This file provides an Arduino-compatible interface to the SparkFun Qwiic
* Optical Tracking Odometry Sensor (OTOS). It wraps the platform-agnostic
* C++ driver to provide familiar Arduino conventions and simplified usage.
*
* Features:
* - Simple Arduino-style begin() function
* - Default Wire interface support
* - Compatible with all Arduino platforms
* - Inherits all functionality from base C++ driver
* - Automatic I2C bus configuration
*
* @author SparkFun Electronics
* @date February 2024
* @copyright Copyright (c) 2024-2025, SparkFun Electronics Inc.
*
* SPDX-License-Identifier: MIT
*
* @see https://github.com/sparkfun/SparkFun_Qwiic_OTOS_Arduino_Library
*/

// ...existing code...

/*******************************************************************************
SparkFun_Qwiic_OTOS_Arduino_Library.h - Arduino wrapper of the C++ driver
Expand All @@ -13,14 +32,16 @@
*******************************************************************************/

#pragma once

// clang-format off
#include "Arduino.h"
#include "sfeQwiicOtos.h"
#include <SparkFun_Toolkit.h>
#include "sfTk/sfDevOTOS.h"
#include <Wire.h>
// clang-format on

/// @brief Arduino class for the SparkFun Qwiic Optical Tracking Odometry Sensor
/// (OTOS)
class QwiicOTOS : public sfeQwiicOtos
class QwiicOTOS : public sfDevOTOS
{
public:
/// @brief Begins the Qwiic OTOS and verifies it is connected
Expand All @@ -32,7 +53,7 @@ class QwiicOTOS : public sfeQwiicOtos
_theI2CBus.init(wirePort, kDefaultAddress);

// Begin the sensor
return sfeQwiicOtos::begin(&_theI2CBus) == kSTkErrOk;
return sfDevOTOS::begin(&_theI2CBus) == ksfTkErrOk;
}

protected:
Expand All @@ -42,5 +63,5 @@ class QwiicOTOS : public sfeQwiicOtos
}

private:
sfeTkArdI2C _theI2CBus;
sfTkArdI2C _theI2CBus;
};
Loading