Skip to content

Instantly share code, notes, and snippets.

View gist:6c0e35ad35c0f96ea323bfe7a8a79400
3Box is a social profiles network for web3. This post links my 3Box profile to my Github account!
✅ did:muport:QmPXsZ1fQBAzsfwp5xR5PRdoxNEjCS1fA7EHy2JdqtV5JM ✅
Create your profile today to start building social connection and trust online. https://3box.io/
View ESP8266_Temperature.ino
/*
Sketch which publishes temperature data from a DS1820 sensor to a MQTT topic.
This sketch goes in deep sleep mode once the temperature has been sent to the MQTT
topic and wakes up periodically (configure SLEEP_DELAY_IN_SECONDS accordingly).
Hookup guide:
- connect D0 pin to RST pin in order to enable the ESP8266 to wake up periodically
- DS18B20:
+ connect VCC (3.3V) to the appropriate DS18B20 pin (VDD)
View WeatherRequest.java
public class WeatherRequest {
private LocationType locationType;
private Float[] coordinates;
private String zipCode;
private String city;
private String state;
private String country;
private Locale locale;
public WeatherRequest forCoordinates(Float coordinateX, Float coordinateY) {
View WeatherService.java
public interface WeatherService {
Observable<WeatherConditions> getConditions(Observable<WeatherRequest> requests);
}
View WeatherConditions.java
public class WeatherConditions {
private Measurable<Temperature> temperature;
private Measurable<Temperature> feelsLikeTemperature;
private Measurable<Temperature> dewPoint;
private Measurable<Dimensionless> relativeHumidity;
private Measurable<Pressure> pressure;
private Measurable<Velocity> windSpeed;
private Measurable<Velocity> windGust;
private Measurable<Angle> windDirection;
private WeatherIcon icon;
@jeje
jeje / DatabaseInitialization.java
Created Dec 9, 2013
Classe Spring lançant Flyway à l'initialisation du contexte.
View DatabaseInitialization.java
import com.googlecode.flyway.core.Flyway;
import com.googlecode.flyway.core.metadatatable.MetaDataTableRow;
import com.googlecode.flyway.core.migration.SchemaVersion;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.InitializingBean;
import javax.sql.DataSource;
import java.util.List;
public class DatabaseInitialization implements InitializingBean {
View LED_Strip_Mosfet_Temp_XBee.ino
// HSV fade/bounce for Arduino - scruss.com - 2010/09/12
// Note that there's some legacy code left in here which seems to do nothing
// but should do no harm ...
#include "OneWire.h"
#include "Streaming.h"
#include <XBee.h>
const int DS18S20_Pin = 2; //DS18S20 Signal pin on digital 2
#define MIN_TEMP 16
@jeje
jeje / RGB_LED_Strip_Mosfet.ino
Last active Jan 22, 2020
RGB LED Strip controlled by an Arduino with the help of MOSFETs
View RGB_LED_Strip_Mosfet.ino
// HSV fade/bounce for Arduino - scruss.com - 2010/09/12
// Note that there's some legacy code left in here which seems to do nothing
// but should do no harm ...
// don't futz with these, illicit sums later
#define RED 9// pin for red LED
#define GREEN 10 // pin for green - never explicitly referenced
#define BLUE 11 // pin for blue - never explicitly referenced
#define SIZE 255
#define DELAY 20
@jeje
jeje / RGB_LED_Strip_Mosfet_Temp.ino
Last active Oct 29, 2015
RGB LED Strip controlled by an Arduino with the help of MOSFETs and DS18B20 temperature sensor
View RGB_LED_Strip_Mosfet_Temp.ino
// HSV fade/bounce for Arduino - scruss.com - 2010/09/12
// Note that there's some legacy code left in here which seems to do nothing
// but should do no harm ...
#include "OneWire.h"
//#include "Streaming.h"
const int DS18S20_Pin = 2; //DS18S20 Signal pin on digital 2
#define MIN_TEMP 18
#define MAX_TEMP 30
@jeje
jeje / gist:3059287
Created Jul 6, 2012
Output on the serial console after pushing the on/off button on the air conditioner remote
View gist:3059287
Ready to decode IR!
Received:
OFF ON
38828 usec, 3520 usec
1500 usec, 580 usec
1080 usec, 580 usec