Skip to content

Instantly share code, notes, and snippets.

View miguelalonso's full-sized avatar

Miguel Alonso Abella miguelalonso

View GitHub Profile
@miguelalonso
miguelalonso / sqflex.piscina
Created March 2, 2015 11:53
sqflex.piscina
// which analog pin to connect
#define THERMISTORPIN A0
// resistance at 25 degrees C
#define THERMISTORNOMINAL 5000
// temp. for nominal resistance (almost always 25 C)
#define TEMPERATURENOMINAL 25
// how many samples to take and average, more takes longer
// but is more 'smooth'
#define NUMSAMPLES 5
// The beta coefficient of the thermistor (usually 3000-4000)
#!/bin/sh
### BEGIN INIT INFO
# Provides: sendtoemoncms
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Put a short description of the service here
# Description: Put a long description of the service here
#!/usr/bin/python
# raspberry pi nrf24l01 hub
# more details at http://blog.riyas.org
# Credits to python port of nrf24l01, Joao Paulo Barrac & maniacbugs original c library
import RPi.GPIO as GPIO
from nrf24b import NRF24
import time
from time import gmtime, strftime
@miguelalonso
miguelalonso / gist:35690910cf6914cf229e
Created November 12, 2014 17:19
Raspi read NRF24L01
#!/usr/bin/python
# raspberry pi nrf24l01 hub
# more details at http://blog.riyas.org
# Credits to python port of nrf24l01, Joao Paulo Barrac & maniacbugs original c library
from nrf24b import NRF24
import time
from time import gmtime, strftime
import sys, string
@miguelalonso
miguelalonso / gist:7ecbdab5fa867464dfee
Created November 12, 2014 17:18
arduino NRF24L01 - prueba
/*
http://blog.riyas.org/search/label/radio
*/
#include <SPI.h>
#include "nRF24L01.h"
#include "RF24.h"
// For using the temperature sensor DS18S20
#include <OneWire.h>
//int DS18S20_Pin = 8; //DS18S20 Signal pin on digital 2
@miguelalonso
miguelalonso / gist:8d9ff58706f25c01c59c
Created November 12, 2014 17:17
arduino NRF24L01
/*
http://blog.riyas.org/search/label/radio
*/
#include <SPI.h>
#include "nRF24L01.h"
#include "RF24.h"
// For using the temperature sensor DS18S20
#include <OneWire.h>
//int DS18S20_Pin = 8; //DS18S20 Signal pin on digital 2
/*
Arduino con ethernet shield para control del aire acondicionado del salon
Miguel Alonso Octubre 2014
Fuentes: varios de internet
- CONNECTIONS: nRF24L01 Modules See:
http://arduino-info.wikispaces.com/Nrf24L01-2.4GHz-HowTo
1 - GND
2 - VCC 3.3V !!! NOT 5V
3 - CE to Arduino pin 9 ->6
4 - CSN to Arduino pin 10 ->7