Skip to content

Instantly share code, notes, and snippets.

@sticilface
sticilface / modbus_MAX31865.ino
Last active Jul 19, 2019
Basic UNO sketch reading MAX31865 v2
View modbus_MAX31865.ino
//-----------------------------------------------------------------------------
// Copyright 2018 Thiago Alves
// This file is part of the OpenPLC Software Stack.
//
// OpenPLC is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// OpenPLC is distributed in the hope that it will be useful,
@sticilface
sticilface / spram_allocator.h
Created Mar 21, 2019
custom PSRAM STL allocator
View spram_allocator.h
template <typename T>
class spram_allocator
{
public:
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef T* pointer;
typedef const T* const_pointer;
typedef T& reference;
typedef const T& const_reference;
View surrogate.ino
/* This sketch lets a RemoteWorker device connected through Ethernet TCP act
as if it is present on the SoftwareBitBang bus connected to this Surrogate
device.
The RemoteWorker sketch can the run on a device not capable of SWBB but
with Ethernet support, like a PC or a Raspberry PI.
Surrogate and RemoteWorker examples contributed by Fred Larsen. */
#define PJON_PACKET_MAX_LENGTH 50
View router.ino
#define SERIAL_METHOD ThroughAsyncSerial // ThroughSerial or ThroughAsyncSerial
#define ROUTER_TYPE 2 // 1 = PJONVirtualBusRouter, 2 = segmented switch...
#define PJON_MAX_PACKETS 3
#define BUS_ID 253
#define PJON_BUS_PIN 2
#define PJON_INCLUDE_SWBB
#define PJON_INCLUDE_ANY
#define PJON_INCLUDE_TAS
View receiver.ino
#define USE_SERIAL
//#define USE_ACK
#define SERIAL_METHOD ThroughAsyncSerial // ThroughSerial or ThroughAsyncSerial
#define SERIAL_SPEED 115200
#define SWBB_PIN 2 // use 2 for arduino, 5 for ESP8266
#if defined (USE_SERIAL) && defined (ESP32)
#define SERIAL_PORT Serial2
@sticilface
sticilface / trans.ino
Last active Jul 29, 2018
Transmitter_speed_sketch
View trans.ino
//#define USE_SERIAL
//#define USE_ACK
#define SERIAL_METHOD ThroughAsyncSerial // ThroughSerial or ThroughAsyncSerial
#define SERIAL_SPEED 115200
#define SWBB_PIN 2 // use 2 for arduino, 5 for ESP8266
#if defined (USE_SERIAL) && defined (ESP32)
#define SERIAL_PORT Serial2
#elif defined (USE_SERIAL)
View gist:7537ee844a7cbb3a3342bc1a9322667d
#define SERIAL_METHOD ThroughSerial // ThroughSerial or ThroughAsyncSerial
#define PJON_MAX_PACKETS 3
#define PJON_BUS_PIN 2
#define PJON_INCLUDE_SWBB
#define PJON_INCLUDE_ANY
#define PJON_INCLUDE_TAS
#define PJON_INCLUDE_TS
@sticilface
sticilface / speedtests.md
Last active Jul 28, 2018
speed tests results PJON Serial
View speedtests.md

Speed Tests

ThroughSerial

Leonado to Leonado (115200 baud)

1 second communication speed test:
Packet Overhead: 10B - Total: 190B
Bandwidth: 570.00B/s

@sticilface
sticilface / test.h
Created Jun 23, 2017
Error when using PROGMEM strings and DEBUG with PSTR() in template functions
View test.h
#ifndef TEST_H
#define TEST_H
#define TEST Serial
const char testString[] PROGMEM = "Test String";
#if defined(TEST)
View Stream timeout.txt
[HTTP-Client][begin] url: http://192.168.1.42/esp/local/MySONOFF/debugsonoff/manifest.json
[HTTP-Client][begin] host: 192.168.1.42 port: 80 url: /esp/local/MySONOFF/debugsonoff/manifest.json
[hostByName] Host: 192.168.1.42 is a IP!
:ref 1
[HTTP-Client] connected to 192.168.1.42:80
:wr 183 183 0
:wrc 183 183 0
:sent 183
:rn 240
:rch 240, 946
You can’t perform that action at this time.