Skip to content

Instantly share code, notes, and snippets.

@ah01
ah01 / test-node-red.sh
Created May 7, 2022 11:42
Jak vyzkoušet více verzí Node-RED tak, aby se neovlivňovali
cd /cesta/k/novemu/node-red
# (1) Stáhne Node-RED do aktuálního adresáře
# všiměte si, že chybí parameter -g, instalujeme do lokálního adresáře
# parametr --save zafixuje verze (při spuštění přes npx už se nekontroluje jestli není nová verze, což trvá dlouho)
npm install --save node-red@next
# (2) Vytvořit settings.js
# Je možné přeskočit, pokud nechcete nic měnit v globální settings.js v uživatelském profilu
# kopie výchozího:
@ah01
ah01 / matrix.py
Created September 18, 2021 20:38
Matrix effect for Pico Scroll Pack board
# Simple Matrix style effect for Pico Scroll Pack board from Pimoroni and MicroPython on Raspbery Pi Pico
# see: https://twitter.com/horcicaa/status/1439327623843307523
# doc: https://shop.pimoroni.com/products/pico-scroll-pack
# https://github.com/pimoroni/pimoroni-pico/tree/main/micropython/modules/pico_scroll
import time
import random
import picoscroll as scroll
@ah01
ah01 / platformio.ini
Last active August 18, 2020 12:25
platformio-examples-article
[env:uno]
platform = atmelavr
board = uno
framework = arduino
lib_deps =
[email protected]
@ah01
ah01 / CsvSeparatorList.cs
Last active January 29, 2020 23:14
List Separators in Different Cultures (separator for CSV in Excel)
using System.Globalization;
namespace ConsoleApp
{
class Program
{
static void Main(string[] args)
{
var cultures = CultureInfo.GetCultures(CultureTypes.AllCultures);
@ah01
ah01 / format.md
Last active July 11, 2018 12:36
BC LoRa Thermometer MSG Format

Message format description

⬆️ Uplink

✉️ Status information message (port 1)

Status message is 7 bytes long and send to port 1.

Contains all information about device including measured temperature. This message is send after reset, button press or after request by sending downlink message Status request.

@ah01
ah01 / cpu-tamp.sh
Created October 11, 2015 14:15
Send CPU temperature to MQTT
while true
do
t=$(cat /sys/class/thermal/thermal_zone0/temp)
t=$(($t/1000))
echo Teplota CPU $t
mosquitto_pub -h mqtt.sh.cvut.cz -t linuxdays/raspberry/temperature -m "$t °C"
sleep 5
done
@ah01
ah01 / demo.cpp
Created December 29, 2014 00:01
Visual Micro - debug code
#include "arduino.h"
#include <VM_DBG.h>
unsigned long time;
bool output;
void setup()
{
// MicroDebug setup
delay(2000);
alert(typeof(f)); // --> function
function f() {}
@ah01
ah01 / 1_jako_plaintext.txt
Last active August 29, 2015 13:57
Co pošle Outlook 2007, když pošlete e-mail s obsahem "Test spojení"...
Test spojení
#include <Bounce.h>
#define PEDAL_PIN 2
Bounce pedal = Bounce(PEDAL_PIN, 50);
void setup()
{
pinMode(PEDAL_PIN, INPUT_PULLUP);
Keyboard.begin();