Skip to content

A collection of Arduino-compatible utility functions and classes commonly used by Vulintus.

License

Notifications You must be signed in to change notification settings

Vulintus/Vulintus_Firmware_Toolbox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vulintus Firmware Toolbox

A collection of Arduino-compatible utility functions and classes commonly used by Vulintus.

Disclaimer: This README file was AI-generated, but checked for accuracy by a human.

Features

  • Voltage Monitoring - Read and monitor analog voltages with configurable voltage divider circuits
  • Task Timer - Execute periodic tasks at precise intervals using millisecond or microsecond resolution

Installation

Arduino IDE

  1. Download this repository as a ZIP file
  2. In Arduino IDE, go to SketchInclude LibraryAdd .ZIP Library
  3. Select the downloaded ZIP file
  4. The library will be added to your Arduino libraries folder

Manual Installation

Copy the Vulintus_Firmware_Toolbox folder to your Arduino libraries directory:

  • Windows: Documents\Arduino\libraries\
  • macOS: ~/Documents/Arduino/libraries/
  • Linux: ~/Arduino/libraries/

Quick Start

Voltage Monitor Example

#include <Vulintus_Utilities.h>

// Create a voltage monitor on pin A0
// Parameters: ADC pin, top resistor (ohms), bottom resistor (ohms), reference voltage (volts)
Vulintus_Voltage_Monitor monitor(A0, 10000.0, 1000.0, 3.3);

void setup() {
  Serial.begin(115200);
  monitor.begin();  // Initialize the monitor
}

void loop() {
  float voltage = monitor.read();  // Read the current voltage
  Serial.print("Voltage: ");
  Serial.print(voltage, 3);
  Serial.println(" V");
  delay(500);
}

Task Timer Example

#include <Vulintus_Utilities.h>

// Create a timer that executes every 250 milliseconds, 10 times total
Vulintus_Task_Timer timer(250, NULL, 10, TIMER_CLOCK_MILLIS);

void setup() {
  Serial.begin(115200);
  
  // Set the callback function to execute
  timer.task_fcn = myTask;
  timer.start();
}

void myTask() {
  Serial.println("Task executed!");
}

void loop() {
  timer.check();  // Check if task should execute
}

API Reference

Vulintus_Voltage_Monitor

Constructor

Vulintus_Voltage_Monitor(uint8_t adc_pin, float rtop = 10000.0, float rbot = 1000.0, float vref = 3.3);

Parameters:

  • adc_pin - Arduino ADC pin to read from
  • rtop - Top resistor value in voltage divider (Ω) [default: 10000]
  • rbot - Bottom resistor value in voltage divider (Ω) [default: 1000]
  • vref - ADC reference voltage (V) [default: 3.3]

Methods

Method Description
begin() Initialize the voltage monitor (call in setup)
read() Return the current monitored voltage in volts

Callbacks

  • display_fcn - Function pointer called to display monitored voltage

Public Variables

  • pin - ADC pin used for monitoring
  • v_ref - ADC reference voltage (volts)
  • r_top - Top resistor value (ohms)
  • r_bot - Bottom resistor value (ohms)

Vulintus_Task_Timer

Constructor

Vulintus_Task_Timer(uint32_t timer_period, void (*task_callback)(void) = NULL, 
                    uint32_t tasks_to_execute = 0, TIMER_CLOCK use_clock = TIMER_CLOCK_MILLIS);

Parameters:

  • timer_period - Time between task executions (millis or micros)
  • task_callback - Optional task function pointer (can be set later)
  • tasks_to_execute - Number of times to execute (0 = infinite)
  • use_clock - Clock type: TIMER_CLOCK_MILLIS or TIMER_CLOCK_MICROS

Methods

Method Description
start() Start the timer and call start_fcn if set
stop() Stop the timer and call stop_fcn if set
check() Check if next task execution is due (call in main loop)

Callbacks

  • start_fcn - Called when timer starts
  • task_fcn - Called when task is due to execute
  • stop_fcn - Called when timer stops

Public Variables

  • period - Timer period (millis or micros)
  • num_executions - Number of times to execute the task (0 = infinite)
  • clock - Clock type used (millis or micros)

Examples

Complete working examples are included in the examples/ folder:

  • LED_Timer - Demonstrates the Vulintus_Task_Timer class by toggling an LED periodically
  • Voltage_Monitor - Demonstrates the Vulintus_Voltage_Monitor class by reading and displaying voltage

Hardware Notes

Voltage Divider Circuit for Voltage_Monitor

To measure voltages higher than your ADC reference voltage, use a voltage divider:

    V_in
      |
      R_top
      |
      +------ (connect to ADC pin)
      |
      R_bot
      |
      GND

The measured voltage will be: V_out = V_in × R_bot / (R_top + R_bot)

Example: To measure 0-15V with a 3.3V ADC (R_top=10kΩ, R_bot=1.13kΩ):

Vulintus_Voltage_Monitor monitor(A0, 10000.0, 1130.0, 3.3);

Board Compatibility

This library is compatible with most Arduino-compatible boards including:

  • Arduino Uno, Nano, Mega
  • Arduino Due, Zero
  • Arduino MKR boards
  • ESP8266, ESP32
  • STM32 boards
  • And other Arduino-compatible platforms

The library automatically detects ADC resolution (10-bit for AVR, 12-bit for other boards).

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

For issues, questions, or suggestions, please contact Vulintus, Inc.


Copyright © 2026 Vulintus, Inc.

About

A collection of Arduino-compatible utility functions and classes commonly used by Vulintus.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages