Skip to content

Instantly share code, notes, and snippets.

@randvoorhies
randvoorhies / gist:2200185
Created March 25, 2012 21:53
A mapping of Arduino Mega pin functionality onto Atmega 1280 pins
=============== =========== ========================
Atmega 1280 Pin Arduino Pin Arduino Special Function
--------------- ----------- ------------------------
PA0 Digital 22
PA1 Digital 23
PA2 Digital 24
PA3 Digital 25
PA4 Digital 26
PA5 Digital 27
PA6 Digital 28
@cbrake
cbrake / 99-usb-serial.rules
Created December 19, 2012 14:47
USB Serial udev rules
# /etc/udev/rules.d/99-usb-serial.rules
# udevadm info --attribute-walk -n /dev/ttyUSB0 |grep serial (can be used to get serial number)
# udevadm control --reload-rules (reload rules)
# udevadm trigger (re-add all devices)
# see https://wiki.archlinux.org/index.php/Bus_pirate
# for some reason, ATTRS{bInterfaceNumber}=="00" is not working, hence the use of ENV{}
# single USB/serial adapters
SUBSYSTEM=="tty", ATTRS{serial}=="A900TUKZ", SYMLINK+="ttyUSB_bub_1"
SUBSYSTEM=="tty", ATTRS{serial}=="A700fdWb", SYMLINK+="ttyUSB_bub_2"
/*
* Simple MD5 implementation
*
* Compile with: gcc -o md5 -O3 -lm md5.c
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
@bkarl
bkarl / u8g_arm.c
Created August 10, 2014 16:34
SSD 1306 STM32
/*
u8g_arm.c
u8g utility procedures for LPC122x
Universal 8bit Graphics Library
Copyright (c) 2013, olikraus@gmail.com
@keriszafir
keriszafir / gpio-interrupt.c
Last active November 8, 2023 10:40
gpio-interrupt - C routine for handling interrupts generated on GPIO
/* Demonstration C GPIO interrupt handling routine for Raspberry Pi
This is a modified code found at https://github.com/phil-lavin/raspberry-pi-gpio-interrupt
The program displays a notice whenever you:
-turn on the Raspberry Pi's pin 11 (apply 3.3V),
-turn the pin off.
This routine uses wiringPi library (follow the installation instructions at wiringpi.com),
and should be compiled with a command:
@virgilvox
virgilvox / mqtt_meshblu_send_receive.ino
Created April 9, 2015 18:51
Use MQTT to send/recieve JSON using an Arduino with Ethernet!
#include <SPI.h>
#include <Ethernet.h>
#include <ArduinoJson.h>
#include <PubSubClient.h>
// Update these with values suitable for your network.
IPAddress ip(192, 168, 0, 177);
@jgrossiord
jgrossiord / gist:0bd525974a5ec059adba
Created June 2, 2015 08:39
Mikrotik script generate address list from DNS cache entries
:foreach i in=[/ip dns cache find] do={
:local bNew "true";
:local cacheName [/ip dns cache all get $i name] ;
# :put $cacheName;
:if (([:find $cacheName "facebook" -1] >= 0) || ([:find $cacheName "outlook" -1] >= 0)) do={
:local tmpAddress [/ip dns cache get $i address] ;
:put $cacheName;
:put $tmpAddress;
@chaeplin
chaeplin / syslog.ino
Created February 2, 2016 16:15
syslog.ino
#include <ESP8266WiFi.h>
#include <WiFiUdp.h>
#define _IS_MY_HOME
// wifi
#ifdef _IS_MY_HOME
#include "/usr/local/src/ap_setting.h"
#else
#include "ap_setting.h"
#endif
@deanet
deanet / How to configure multiple modem PlaySMS Gammu
Created September 15, 2016 06:54
How to configure multiple modem PlaySMS Gammu
How to configure multiple modem PlaySMS Gammu. These are ways to works with outgoing sms (sent reports) and incoming sms (inbox reports) with multiple modem on PlaySMS.
@codexss
codexss / smstools3.md
Last active July 26, 2024 03:55
Openwrt/LEDE smstools3 forward sms to telegram
opkg update
opkg install kmod-usb-serial kmod-usb-serial-wwan kmod-usb-serial-option usb-modeswitch smstools3 curl iconv

vi /usr/local/bin/pushsms

#!/bin/sh