Skip to content

Instantly share code, notes, and snippets.

/////////////////////////////////////////////////////////////////////
// This is a simple example of sending CAN messages with 11bit id's
//
// https://matthewcmcmillan.blogspot.com
// Twitter: @matthewmcmillan
//
#include "mcp_can.h"
#include <SPI.h>
/////////////////////////////////////////////////////////////////////
// This is a simple example of sending CAN messages with 29bit id's
//
// https://matthewcmcmillan.blogspot.com
// Twitter: @matthewmcmillan
//
#include "mcp_can.h"
#include <SPI.h>
@matt448
matt448 / hx711_calibration.ino
Last active March 13, 2023 16:56
HX711 Calibration for Arduino
/*
Started with example code written by Nathan Seidle from SparkFun Electronics and added
LCD output with gram and ounce values.
Setup your scale and start the sketch WITHOUT a weight on the scale
Once readings are displayed place the weight on the scale
Press +/- or a/z to adjust the calibration_factor until the output readings match the known weight
Arduino pin 6 -> HX711 CLK
Arduino pin 5 -> HX711 DOUT
@matt448
matt448 / Speedometer_TM1637.ino
Created January 13, 2016 02:30
Digital speedometer using a TM1637 type display
// Matthew McMillan
// @matthewmcmillan
// http://matthewcmcmillan.blogspot.com
//
// Digital speedometer that uses a TM1637 type display
//
// Code is written for an Arduino UNO
//
// VSS on car connects to digital pin 5
// CLK on display to digital pin 3
@matt448
matt448 / Speedometer_HMI.ino
Created June 1, 2017 15:47
Arduino based speedometer using a Nextion HMI Display
#include "Nextion.h"
const int lightPin = 0;
const int hardwareCounterPin = 5;
const int samplePeriod = 1000; //in milliseconds
const float pulsesPerMile = 4000;
const float convertMph = pulsesPerMile/3600;
unsigned int count;
float mph;