Skip to content

Instantly share code, notes, and snippets.

View matthijskooijman's full-sized avatar

Matthijs Kooijman matthijskooijman

View GitHub Profile
Bij het ontwerp van het MJS meetstation is evoor gekozen om zo min mogelijk
"moeilijke" componenten te gebruiken.
De schakeling is zo opgebouwd dat de sensor met twee stroommeetweerstanden kan
worden uitgelezen.
Om het aantal verschillende weerstandswaarden in het bouwpakket te beperken is
zijn daarvoor 10K (R11) en 100K (R12)  gekozen. Dit
zijn de standaard waarden die in het bouwpakket zitten.
Door R11 te verkleinen naar bijvoorbeeld 2K2 kan je het bereik van de sensor
verhogen.
In de code dien je dan de waarde voor R11 aan te passen:
diff -Nru grfcodec-6.0.6/debian/changelog grfcodec-6.0.6/debian/changelog
--- grfcodec-6.0.6/debian/changelog 2018-05-10 21:42:34.000000000 +0200
+++ grfcodec-6.0.6/debian/changelog 2019-03-12 21:36:07.000000000 +0100
@@ -1,3 +1,19 @@
+grfcodec (6.0.6-3) unstable; urgency=medium
+
+ [ Jordi Mallach ]
+ * [bc95db0] Force build to abort upon endian_check.cpp build failure.
+ Thanks to Helmut Grohne for suggesting this fix (Closes: #922625)
+ * [63c5aa0] Move M-A field to binary section.
matthijs@grubby:/usr/lib/avr/include/avr$ grep END iom328p.h
#define RAMEND 0x8FF /* Last On-Chip SRAM Location */
#define XRAMEND RAMEND
#define E2END 0x3FF
#define FLASHEND 0x7FFF
# Pinout based on http://doswa.com/2010/08/24/avrdude-5-10-with-ftdi-bitbang.html
# I could not use the builtin ft232r and others, since these all need
# different handshaking pins
programmer
id = "ftdi_cts_dtr";
desc = "FTDI adapter with CTS and DTR exposed";
type = "ftdi_syncbb";
connection_type = usb;
miso = 1; # RXD
sck = 3; # CTS
@matthijskooijman
matthijskooijman / gist:89e3fd69aaf714466524eb93f7197260
Created August 29, 2018 14:55
Read AVR / Atmega2560 signature byte area; signature is at addresses 0, 2, 4, calibration byte is at address 1
#include <avr/boot.h>
void setup() {
Serial.begin(115200);
// put your setup code here, to run once:
for (uint8_t i = 0; i < 16; ++i) {
Serial.print(i);
Serial.print(": ");
Serial.println(boot_signature_byte_get(i), HEX);
}
%YAML 1.1
---
# meetjestad.sensors_measurement
-
id: 2591299
station_id: 122
message_id: 2560602
timestamp: "2018-05-17 07:00:57"
latitude: 52.1712
longitude: 5.3945
@matthijskooijman
matthijskooijman / gist:0bb6ef88d086b7dd2e01f669f75699a1
Created April 30, 2018 13:16
ICU symbols used by OpenTTD 1.8.0 from ICU 60
0000000000000000 DF *UND* 0000000000000000 icu_60::ParagraphLayout::Line::getWidth() const
0000000000000000 DF *UND* 0000000000000000 icu_60::BreakIterator::createCharacterInstance(icu_60::Locale const&, UErrorCode&)
0000000000000000 DF *UND* 0000000000000000 icu_60::LEFontInstance::unitsToPoints(LEPoint&, LEPoint&) const
0000000000000000 DF *UND* 0000000000000000 icu_60::LEFontInstance::~LEFontInstance()
0000000000000000 DF *UND* 0000000000000000 icu_60::Locale::~Locale()
0000000000000000 DF *UND* 0000000000000000 icu_60::LEFontInstance::yPixelsToUnits(float) const
0000000000000000 DF *UND* 0000000000000000 icu_60::Collator::createInstance(icu_60::Locale const&, UErrorCode&)
0000000000000000 DF *UND* 0000000000000000 icu_60::UMemory::operator new(unsigned long)
0000000000000000 DF *UND* 0000000000000000 icu_60::StringPiece::StringPiece(char const*)
// This approach is the simplest and does not fix the rounding issue, so
// this OK/-1/-2/-3 pattern repeats over and over (all delays are
// rounded down to a multiple of 3)
delayMicroseconds(0): ERR: 5 cycles == 5.00us
delayMicroseconds(1): ERR: 4 cycles == 4.00us
delayMicroseconds(2): ERR: 3 cycles == 3.00us
delayMicroseconds(3): ERR: 2 cycles == 2.00us
delayMicroseconds(4): ERR: 1 cycles == 1.00us
delayMicroseconds(5): OK
delayMicroseconds(6): ERR: -1 cycles == -1.00us
@matthijskooijman
matthijskooijman / 00Results
Created February 8, 2018 11:57
delayMicroseconds test - Paul's implementation
>> Constants @16Mhz
delayMicroseconds(0): OK
delayMicroseconds(1): OK
delayMicroseconds(2): OK
delayMicroseconds(3): OK
delayMicroseconds(4): OK
delayMicroseconds(5): OK
delayMicroseconds(6): OK
delayMicroseconds(7): OK
delayMicroseconds(8): OK
@matthijskooijman
matthijskooijman / 00Results
Last active February 8, 2018 11:41
delayMicroseconds test - original implementation
>> Constants @24Mhz
delayMicroseconds(0): OK
delayMicroseconds(1): ERR: -17 cycles == -0.71us
delayMicroseconds(2): ERR: -17 cycles == -0.71us
delayMicroseconds(3): ERR: -17 cycles == -0.71us
delayMicroseconds(4): ERR: -18 cycles == -0.75us
delayMicroseconds(5): ERR: -17 cycles == -0.71us
delayMicroseconds(6): ERR: -19 cycles == -0.79us
delayMicroseconds(7): ERR: -17 cycles == -0.71us
delayMicroseconds(8): ERR: -19 cycles == -0.79us