Skip to content

Instantly share code, notes, and snippets.

@fjrg76-com
fjrg76-com / digital_dimmer.ino
Created January 23, 2023 20:24
Digital dimmer with the Arduino UNO
/* Copyright (C)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@fjrg76-com
fjrg76-com / conditionVariable.cpp
Last active June 6, 2022 17:47
An example of a condition variable implementation using mutex'es from FreeRTOS for a NXP chip; however, it's easily portable to other architectures.
/*Copyright (C)
* 2021 - fjrg76 at hotmail dot com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@fjrg76-com
fjrg76-com / mutex_monitor.ino
Last active June 6, 2022 04:13
Monitors using FreeRTOS mutex'es. The monitor example protects the Arduino's ADC.
#include <stdint.h>
#include <FreeRTOS.h>
#include <task.h>
#include <semphr.h>
class AdcMonitor
{
private:
SemaphoreHandle_t mutex{ NULL };