Skip to content

Instantly share code, notes, and snippets.

View maxmacstn's full-sized avatar
🏠
Working from home

Sitinut Waisara maxmacstn

🏠
Working from home
View GitHub Profile
@maxmacstn
maxmacstn / config.json
Last active April 23, 2024 18:09
WiFikit Serial config for Homebridge
// 1. connect the module to Wi-Fi and MQTT
// 2. Install mqttthing add-on into HomeBridge.
// 3. Add the following section to mqttthing JSON configuration (inside accessories array)
// 4. Change mqtt url, username, password and YOUR_DEVICE_FRIENDLY_NAME to match your setup.
{
"accessory": "mqttthing",
"type": "custom",
"url": "<192.168.1.XXX:1883>",
@maxmacstn
maxmacstn / main.py
Last active January 11, 2024 19:23
Raspberry Pi Pico - CircuitPython volume knob
import digitalio
import board
import usb_hid
import time
from adafruit_hid.keyboard import Keyboard
from adafruit_hid.mouse import Mouse
from adafruit_hid.keycode import Keycode
from adafruit_hid.consumer_control import ConsumerControl
from adafruit_hid.consumer_control_code import ConsumerControlCode
@maxmacstn
maxmacstn / lcd_1602_temp.c
Last active January 29, 2021 10:25
Raspberry Pi Pico internal temperature sensor with LCD 16x2 example.
/**
*
* Raspberry Pi Pico internal temperature sensor with LCD 16x2 example.
*
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
*
* Adapted by MaxMacSTN
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@maxmacstn
maxmacstn / NBIoTPreEntry.ino
Created March 7, 2020 12:09
NB-IoT Pre entry climate control
/*
Supported DEVIO NB-DEVKIT I Board
| Do not use PIN |
| 16 TX |
| 17 RX |
| 4 EINT |
| 26 power key |
| 27 reset |
This is an example for DEVIO NB-DEVKIT I. That has get swich data from Magellan IoT Platform for control LED on board.
/*
* doorBell_test.ino
* Copyright (c) 2019 Sitinut Waisara
* magiapp.me | github.com/maxmacstn
*/
int signalPin = D1;
void setup() {
Serial.begin(115200);
/*
* Copyright (c) 2019 Sitinut Waisara
* magiapp.me | github.com/maxmacstn
*
* For sending notification + IP Cam snapshot image to Line Notify when Doorbell was pressed.
*
* Hardware : Generic doorbell with active high or you can connect with button + generic Chinese P2P IP Cam
*
*/
@maxmacstn
maxmacstn / fact.pl
Last active December 19, 2018 05:30
prolog fact
/**
* Distance between two station
*
* dist(start, stop, minute).
*/
% Airport link
dist(arl_phaya_thai, arl_ratchaprarop, 60).
dist(arl_ratchaprarop, arl_makkasan, 180).
@maxmacstn
maxmacstn / BTSPrice.js
Last active November 24, 2018 15:57
SmartTransit - BTS Raw DB
/*** Data from http://m.bts.co.th/mweb1/webpages/fare.aspx ***/
/*** ราคา SJT(Single journey trip) ***/
var N8_SJT_Array= new Array(" --- ค่าบริการ ---| --- ระยะเวลา ---","16","16","23","26","30","33","37","40","44","44","44","44","44","44","44","44","44","44","59","59","59","59","59","59","44","44","44","44","44","44","44","44","44","59","59","59","59");
var N7_SJT_Array= new Array(" --- ค่าบริการ ---| --- ระยะเวลา ---","16","16","16","23","26","30","33","37","40","44","44","44","44","44","44","44","44","44","59","59","59","59","59","59","44","44","44","44","44","44","44","44","44","59","59","59","59");
var N6_SJT_Array= new Array(" --- ค่าบริการ ---| --- ระยะเวลา ---","23","16","16","16","23","26","30","33","37","40","44","44","44","44","44","44","44","44","59","59","59","59","59","59","40","40","44","44","44","44","44","44","44","59","59","59","59");
var N5_SJT_Array= new Array(" --- ค่าบริการ ---| --- ระยะเวลา ---","26","23","16","16","16","23","26","30","33","37","40","44","44","44","44","44","4
@maxmacstn
maxmacstn / DemoReel100.ino
Created December 1, 2017 14:28 — forked from kriegsman/DemoReel100.ino
FastLED "100-line" demo reel
#include "FastLED.h"
// FastLED "100-lines-of-code" demo reel, showing just a few
// of the kinds of animation patterns you can quickly and easily
// compose using FastLED.
//
// This example also shows one easy way to define multiple
// animations patterns and have them automatically rotate.
//
// -Mark Kriegsman, December 2014