This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
ldr.py | |
Display analog data from Arduino using Python (matplotlib) | |
Author: Mahesh Venkitachalam | |
Website: electronut.in | |
""" | |
import sys, serial, argparse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// analog-plot | |
// | |
// Read analog values from A0 and A1 and print them to serial port. | |
// | |
// electronut.in | |
#include "Arduino.h" | |
void setup() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################################################################ | |
# conway.py | |
# | |
# Author: electronut.in | |
# | |
# Description: | |
# | |
# A simple Python/matplotlib implementation of Conway's Game of Life. | |
################################################################################ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Name: Makefile | |
# | |
# A simple program for the ATtiny84 that blinks an LED. | |
# | |
# electronut.in | |
DEVICE = attiny84 | |
CLOCK = 8000000 | |
PROGRAMMER = -c usbtiny | |
OBJECTS = main.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//********************************************************************** | |
// | |
// Putting the ATmega168 into Power Save mode, and then waking it | |
// with a pin-change interrupt. | |
// | |
// electronut.in | |
//********************************************************************** | |
/* | |
build commands on OS X with CrossPack: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Makefile for programming the ATtiny85 | |
# modified the one generated by CrossPack | |
DEVICE = attiny85 | |
CLOCK = 8000000 | |
PROGRAMMER = -c usbtiny | |
OBJECTS = main.o | |
# for ATTiny85 | |
# see http://www.engbedded.com/fusecalc/ | |
FUSES = -U lfuse:w:0x62:m -U hfuse:w:0xdf:m -U efuse:w:0xff:m |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
koch.py | |
Description: | |
A program that explores the Koch snowflake and the Thue-Morse sequence. | |
Author: Mahesh Venkitachalam | |
Website: electronut.in | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int main(void) | |
{ | |
uint32_t err_code; | |
APP_TIMER_INIT(APP_TIMER_PRESCALER, APP_TIMER_OP_QUEUE_SIZE, false); | |
ble_stack_init(); | |
advertising_init(); | |
timers_init(); | |
advertising_start(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# constant | |
pow_16 = 65536.0 | |
# decode temperature | |
def decodeT(temp_val): | |
return ((temp_val / pow_16) * 165 - 40) | |
# decode humidity | |
def decodeH(humid_val): | |
return ((humid_val / pow_16) * 100) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
ledctrl.py | |
A simple example for communicating with a Raspberry Pi from you phone's | |
browser. Uses the Bottle Python web framework, and jQuery AJAX. | |
Author: Mahesh Venkitachalam / electronut.in | |
""" |
NewerOlder