Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
torrentid=$1
torrentname=$2
torrentpath=$3
dir="$(basename $3)"
ln -s $3 ~/LFTP/$3
@sixstringsg
sixstringsg / N2kMessages.h
Created August 1, 2016 18:30
Updated N2kMessages for DynamicTranny flags
/*
N2kMessages.h
2015-2016 Copyright (c) Kave Oy, www.kave.fi All right reserved.
Author: Timo Lappalainen
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
void SendN2KTransmissionParam() {
static unsigned long TransmissionUpdated=millis();
tN2kMsg N2kMsg;
if (TransmissionUpdated+TransmissionUpdatePeriod<millis()) {
TransmissionUpdated=millis();
SetN2kTransmissionParameters(N2kMsg,1,N2kTG_Forward,TransmissionOilPressure(),
TransmissionOilTemperature(),0x0);
NMEA2000.SendMsg(N2kMsg);
}
}
int sensorPin = A0;
int model = 2245;
double voltageLow = 1.05;
double voltageHigh = 4.88;
bool debugMode = true;
inline double PSIToPascal(double v) { return v*6894; }
void setup() {
pinMode(sensorPin, INPUT);
}
2.59V R_th = 10770.79Ohm - T =23.32C
2.59V R_th = 10770.79Ohm - T =23.32C
2.59V R_th = 10770.79Ohm - T =23.32C
2.59V R_th = 10770.79Ohm - T =23.32C
2.60V R_th = 10813.01Ohm - T =23.23C
2.60V R_th = 10813.01Ohm - T =23.23C
2.60V R_th = 10813.01Ohm - T =23.23C
2.60V R_th = 10813.01Ohm - T =23.23C
2.60V R_th = 10813.01Ohm - T =23.23C
2.60V R_th = 10813.01Ohm - T =23.23C
// which analog pin to connect
#define THERMISTORPIN A0
// resistance at 25 degrees C
#define THERMISTORNOMINAL 10000
// 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)
#include <math.h>
#define READING_PIN 0
double R1 = 10000; //resistance put in parallel
double V_IN = 5.0;
double A = 1.129148e-3;
double B = 2.34125e-4;
double C = 8.76741e-8;
double K = 9.5; // mW/dec C – dissipation factor
/*
Physical Pixel
An example of using the Arduino board to receive data from the
computer. In this case, the Arduino boards turns on an LED when
it receives the character 'H', and turns off the LED when it
receives the character 'L'.
The data can be sent from the Arduino serial monitor, or another
program like Processing (see code below), Flash (via a serial-net
@sixstringsg
sixstringsg / physicalpixel.ino
Created December 2, 2015 02:04
Modified script to turn sprinklers off after a set amount of time
/*
Physical Pixel
An example of using the Arduino board to receive data from the
computer. In this case, the Arduino boards turns on an LED when
it receives the character 'H', and turns off the LED when it
receives the character 'L'.
The data can be sent from the Arduino serial monitor, or another
program like Processing (see code below), Flash (via a serial-net
/*********************************************************************
** Description: **
** This file is a sample code for your reference. **
** **
** Copyright (C) 2011 ElecFreaks Corp. **
** Created by ElecFreaks Robi.W /29 Sep 2011 **
** **
** http://elecfreaks.taobao.com **
*********************************************************************/
#include <NewSoftSerial.h>