Skip to content

Instantly share code, notes, and snippets.

@ericdes
ericdes / TeensyE85.ino
Created November 30, 2017 10:51
TeensyE85.ino (initial release)
/*
Authors: Eric Desgranges
Licensed under the GNU General Public License v3.0
*/
#include <FlexCAN.h>
// Teensy 2.0 has the LED on pin 11
// Teensy++ 2.0 has the LED on pin 6
// Teensy 3.x / Teensy LC have the LED on pin 13
@ericdes
ericdes / CanBusSim.ino
Created November 29, 2017 10:56
CAN Bus simulator (initial)
#include <mcp_can.h>
#include <SPI.h>
MCP_CAN CAN(10); // Set CS to pin 10
void setup()
{
Serial.begin(115200);
START_INIT:
@ericdes
ericdes / MainPage.xaml.cs
Created February 27, 2016 18:59
TelaReactiveSourceCache
private void LoadFromJson_Click(object sender, RoutedEventArgs e)
{
if (_json == null) return;
var myTrades = JsonConvert.DeserializeObject<TelaReactiveSourceCache<Trade, string>>(_json);
ViewModel.TradesSource = myTrades;
}
// OK
private void AddTrade_Click(object sender, RoutedEventArgs e)
{
var tradeCount = ViewModel.MyTrades.Count;
ViewModel.TradesSource.AddOrUpdate(Trade.Generate(tradeCount));
}
// UPDATE NOT PROPAGATED TO VIEW
private void UpdateMarketPrice_Click(object sender, RoutedEventArgs e)