Skip to content

Instantly share code, notes, and snippets.

@wendlers
wendlers / spi_slave.c
Last active March 2, 2020 16:00
MSP430 SPI slave
#include "msp430g2553.h"
#include <legacymsp430.h>
int main(void)
{
WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer
WDTCTL = WDTPW + WDTHOLD; // Stop WDT
BCSCTL1 = CALBC1_1MHZ; // Set DCO
DCOCTL = CALDCO_1MHZ;
@wendlers
wendlers / Makefile
Created November 12, 2014 20:06
Toggle GPIO with IOCTL and Micropython
obj-m += pyb_gpio.o
ksrc = "$(LINUX_DIR)"
sysr = "$(PWD)/../deploy"
mdir = "extra"
all:
make -C $(ksrc) M=$(PWD) modules
modules_install:
@wendlers
wendlers / nio.py
Created November 9, 2014 20:32
sysfsdiomp.py
##
# The MIT License (MIT)
#
# Copyright (c) 2014 Stefan Wendler
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
@wendlers
wendlers / 01_http_post.sh
Last active July 21, 2020 17:54
EDIMAX Smart Plug XML for programming scheduling
#!/bin/bash
FILE=$1
# REPLACE WITH YOUR PASSWORD/PLUG-IP
URL=http://admin:1234@172.16.100.75:10000/smartplug.cgi
curl -X POST -d @${FILE} ${URL}
@wendlers
wendlers / smartplug.py
Last active October 16, 2023 21:41
Simple library/command-line-utility to control a EDIMAX Smart Plug Switch (SP-1101W) from Python
##
# The MIT License (MIT)
#
# Copyright (c) 2014 Stefan Wendler
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
@wendlers
wendlers / camrec.sh
Created November 19, 2012 20:02
Simple gstreamer pipeline to record a video captured from a webcam to OGG while showing the video also on the screen.
#!/bin/sh
##
# Simple gstreamer pipeline to record a video captured from a webcam (through v4l) to OGG file while
# showing the video also on the screen.
#
# Sample usage:
#
# Record to webcam.ogg:
#