Skip to content

Instantly share code, notes, and snippets.

@electronut
electronut / ardu_alert.ino
Created April 24, 2014 15:42
read serial port and turn leds on/off
// ardu_alert.ino
//
// read serial port and turn leds on/off
//
// Mahesh Venkitachalam
// electronut.in
#include "Arduino.h"
@electronut
electronut / ardu_alert.py
Created April 24, 2014 15:36
Alert Arduino via serial port when an event happens on the host computer.
"""
ardu_alert.py
Alert Arduino via serial port when an event happens on the host computer.
Author: Mahesh Venkitachalam
Website: electronut.in
"""
@electronut
electronut / attiny84-hacks.c
Last active August 29, 2015 14:01
Various ATtiny84 hacks
//************************************************************
// attiny84-hacks.c
//
// Various snippets of code that I have developed for
// the ATtiny84
//
// Author: Mahesh Venkitachalam
// Website: electronut.in
//************************************************************
@electronut
electronut / alganal.py
Last active August 29, 2015 14:04
A utility program to plot algorithmic time complexity of a function.
"""
alganal.py
Description:
A utility program to plot algorithmic time complexity of a function.
Author: Mahesh Venkitachalam
Website: electronut.in
"""
@electronut
electronut / test_HW_PWM.py
Created November 22, 2014 14:42
For testing the hardware PWM capabilities of the Raspberry Pi Model A+.
"""
test_HW_PWM.py
For testing the hardware PWM capabilities of the Raspberry Pi Model A+.
Author: Mahesh Venkitachalam
Website: electronut.in
"""
import wiringpi2 as wiringpi
@electronut
electronut / main.c
Created July 23, 2015 12:02
Test code nRF51822 GPIO
/*
Author: Mahesh Venkitachalam
Website: electronut.in
Reference:
http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk51.v9.0.0%2Findex.html
@electronut
electronut / atmega168-serial.c
Last active December 17, 2015 12:29
ATmega168 serial communications (transmit only) - most code is from the data sheet.
#define BAUD 9600
#define MYUBRR F_CPU/16/BAUD-1
void USART_Init(unsigned int ubrr)
{
/*Set baud rate */
UBRR0H = (unsigned char)(ubrr>>8);
UBRR0L = (unsigned char)ubrr;
/*Enable receiver and transmitter */
UCSR0B = (1<<RXEN0)|(1<<TXEN0);
@electronut
electronut / HC-SR04-test.ino
Created May 28, 2013 12:54
Get distance information from Ultrasonic Ranging Module HC-SR04 and send it via serial port.
// HC-SR04-test.ino
//
// Get distance information from Ultrasonic Ranging Module HC-SR04 and
// send it via serial port.
//
// electronut.in
#include "Arduino.h"
int pinTrigger = 2;
@electronut
electronut / Makefile
Created June 12, 2013 09:17
A Makefile for ATtiny84 AVR programming.
# Name: Makefile
#
# A Makefile for the ATtiny84.
#
# electronut.in
DEVICE = attiny84
CLOCK = 8000000
PROGRAMMER = -c usbtiny
OBJECTS = main.o
@electronut
electronut / testGPIO.py
Created June 18, 2013 06:48
blinking an LED with Raspberry Pi. LED is connected on pin 18 (GPIO5)
# blinking an LED with Raspberry Pi. LED is connected on pin 18 (GPIO5)
#
# run this as:
# sudo python test.py
#
# electronut.in
import time
import RPi.GPIO as GPIO