Skip to content

Instantly share code, notes, and snippets.

@electronut
electronut / speech-test.py
Last active December 19, 2015 09:29
Testing Raspberry Pi audio using pyttsx - Python Cross-platform text-to-speech wrapper.
###############################################################################
# speech-test.py
#
# Author: electronut.in
#
# Description:
#
# Testing Raspberry Pi audio using pyttsx - Python Cross-platform
# text-to-speech wrapper
#
@electronut
electronut / bkup-pi.sh
Created July 6, 2013 02:52
backup script for Raspberry Pi - tested on OS X
# backup script for Raspberry Pi
#
# electronut.in
#
#!/bin/bash
echo Backing up RPi \#1...
# set this to Raspberry Pi IP address
PI_ADDR="192.168.4.31"
@electronut
electronut / attiny84-hcsr04.c
Created June 7, 2013 15:37
Talking to ultrasonic sensor HC-SR04 with an ATtiny84, and sending distance data using serial communications.
//
// Talking to ultrasonic sensor HC-SR04 with an ATtiny84, and
// sending distance data using serial communications.
//
// electronut.in
//
#include <avr/io.h>
#include <string.h>
#include <util/delay.h>
@electronut
electronut / rpi-cat9532.py
Created June 29, 2013 11:04
Raspberry Pi communicating with I2C PWM chip CAT9532 (16-bit Programmable LED Dimmer)
###############################################################################
# rpi-cat9532.py
#
# Author: electronut.in
#
# Description:
#
# Raspberry Pi communicating with I2C PWM chip CAT9532
# (16-bit Programmable LED Dimmer)
#
"""
ldr.py
Display analog data from Arduino using Python (matplotlib)
Author: Mahesh Venkitachalam
Website: electronut.in
"""
import sys, serial, argparse
@electronut
electronut / dht11_thingspeak.py
Last active December 27, 2016 04:24
Temperature/Humidity monitor using Raspberry Pi and DHT11. Data is displayed at thingspeak.com
"""
dht11_thingspeak.py
Temperature/Humidity monitor using Raspberry Pi and DHT11.
Data is displayed at thingspeak.com
Author: Mahesh Venkitachalam
Website: electronut.in
"""
@electronut
electronut / bluey-upload.py
Created June 4, 2017 07:19
Uploads DFU OTA bootloader to bluey board
"""
upload.py
Uploads DFU OTA bootloader to bluey board.
Electronut Labs
electronut.in
"""
@electronut
electronut / bluey-beacon-main1.c
Last active June 12, 2017 06:16
bluey-beacon - advertising_init
static void advertising_init(void)
{
uint32_t err_code;
ble_gap_conn_sec_mode_t sec_mode;
BLE_GAP_CONN_SEC_MODE_SET_OPEN(&sec_mode);
err_code = sd_ble_gap_device_name_set(&sec_mode,
@electronut
electronut / Bluey Beacon set_adv_data.c
Last active June 13, 2017 11:42
Bluey Beacon set_adv_data()
// set adv data
void set_adv_data(bool init)
{
uint32_t err_code;
ble_advdata_t advdata;
uint8_t flags = BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED;
ble_advdata_manuf_data_t manuf_data; // Variable to hold manufacturer specific data
// Initialize with easily identifiable data
@electronut
electronut / process_uid.py
Created June 14, 2017 09:28
Process BLE UUID to code format...
"""
process_uid.py
eg.
Input: 80c4a66b-ddb7-46e3-87bc-ae7053faf6ee
Output: 0xee,0xf6,0xfa,0x53,0x70,0xae,0xbc,0x87,0xe3,0x46,0xb7,0xdd,0x6b,0xa6,0xc4,0x80
electronut.in