Skip to content

Instantly share code, notes, and snippets.

View MGDSStudio's full-sized avatar

Alexander Gorodilov MGDSStudio

View GitHub Profile
@MGDSStudio
MGDSStudio / LedStripController.cpp
Created April 21, 2023 13:25
Controller for LED-strips with chips ws2811. The code doesn't use SPI and I2C.
#include <iostream>
#include <chrono>
#include <thread>
void switchOnLeds(int firstLed, int lastLed);
void digitalWrite(int pin, bool statement);
int main()
{
switchOnLeds(0, 4);
@MGDSStudio
MGDSStudio / LedChainManager.java
Created April 21, 2023 09:11
Code to control a LED-strip based on chips ws2811. It switches on a line of LEDs white (parameter 2>parameter1) or switches all the LEDs off (parameter 1 = 0; parameter 2 = 0)
public class LedChainManager extends Manager{
private LinuxRaspberryPiGpioManager linuxRaspberryPiGpioManager;
private int parameter1, parameter2;
private static LedStrip ledStrip;
private final int leds = 10;
public LedChainManager(LinuxRaspberryPiGpioManager linuxRaspberryPiGpioManager) {
this.linuxRaspberryPiGpioManager = linuxRaspberryPiGpioManager;
init();