Skip to content

Instantly share code, notes, and snippets.

@kd8bxp
kd8bxp / EZ-CommsShieldSketchforLeonardoandMEGA2560.ino
Created March 18, 2019 23:41
Modification of example EZ-Comms Shield sketch by Patrick Mitchell to use SoftwareSPI library by RevPhil
// THIS CODE SHOWS YOU HOW TO CONTROL ALL FEATURES ON THE COMMS SHIELD
#include <SoftwareSPI.h> //https://github.com/RevPhil/arduino_SoftwareSPI
// this SSPI demo uses the UNO SPI pins for convenience
#define SCK_PIN 13
#define MISO_PIN 12
#define MOSI_PIN 11
#define CS_PIN 10
#define SELECT *csReg &= ~csBit;
#define DESELECT *csReg |= csBit;
@kd8bxp
kd8bxp / x-8266_ternary_digital_clock.ino
Created January 8, 2019 01:03
Ternary Digital Clock for the X-8266 and X-Ring (12 WS2812 pixel ring) Based on code from LAGSILVA found at https://www.hackster.io/lagsilva/ternary-digital-clock-with-arduino-772135
/*
Copyright (c) 2019 LeRoy Miller
This program 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.
This program is distributed in the hope that it will be useful,
#include "Arduino.h"
#include "Robot.h"
Robot::Robot() {
}
void Robot::begin() {
pinMode(LEFT_PWM_PIN, OUTPUT);
pinMode(LEFT_1_PIN, OUTPUT);
pinMode(LEFT_2_PIN, OUTPUT);
/*
Copyright (c) 2019 LeRoy Miller
This program 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.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@kd8bxp
kd8bxp / RaspberryPI-LBT.cpp
Created May 2, 2018 23:13
Little Buddy Talker CPP code for Raspberry PI - based on the original Arduino code for the LBT. This just says all the words in the device.
/*
* Based on example code found at:
* https://learn.sparkfun.com/tutorials/raspberry-pi-spi-and-i2c-tutorial
* and the original Arduino code for the Little Buddy Talker
* http://www.engineeringshock.com/the-little-buddy-talker-project-page.html
* April 2018 by LeRoy Miller (C) 2018
* This example says all of the 254 words in the LBT.
*/
#include <iostream>
@kd8bxp
kd8bxp / errors.txt
Created January 6, 2018 18:33
Arduino 1.8.4 and 1.8.5 compile errors for ESP32 BLE libraries (ESP-Alerts-For-Arduino) on Linux Mint 18.3 (64bit)
Archiving built core (caching) in: /tmp/arduino_cache_867389/core/core_espressif_esp32_lolin32_FlashFreq_80,UploadSpeed_921600_e9bab7561037436f3da11df45f0a1c0e.a
sketch/esp32_android.ino.cpp.o:(.literal._ZN29DisplayCharacteristicCallback7onWriteEP17BLECharacteristic[DisplayCharacteristicCallback::onWrite(BLECharacteristic*)]+0x14): undefined reference to `BLECharacteristic::getValue[abi:cxx11]()'
Multiple libraries were found for "Wire.h"
sketch/esp32_android.ino.cpp.o:(.literal._ZN29DisplayCharacteristicCallback7onWriteEP17BLECharacteristic[DisplayCharacteristicCallback::onWrite(BLECharacteristic*)]+0x18): undefined reference to `BLECharacteristic::getUUID()'
Used: /home/lfmiller/Arduino/hardware/espressif/esp32/libraries/Wire
Not used: /home/lfmiller/Arduino/libraries/Wire
sketch/esp32_android.ino.cpp.o:(.literal._ZN29DisplayCharacteristicCallback7onWriteEP17BLECharacteristic[DisplayCharacteristicCallback::onWrite(BLECharacteristic*)]+0x1c): undefined reference to `BLEUUID::toString[abi:cxx11]()'
sketch/e
/* Modified by LeRoy Miller (c) 2017, modification shows how to do the base project with just one Arduino UNO
*
* Highly based on https://www.instructables.com/id/Add-Lights-and-Spooky-Music-to-Your-Jack-O-Lantern/
* By More than the Sum
*
*/
#include <Adafruit_NeoPixel.h>
#include <TimedAction.h>
@kd8bxp
kd8bxp / Console Output
Last active October 3, 2017 15:51
Errors out on me, not sure why.
irection: Backward. Count: 50
Direction: Backward. Count: 98
Direction: Backward. Count: 0
Direction: Backward. Count: 52
Direction: Backward. Count: 100
Direction: Backward. Count: 150
Direction: Backwa⸮Hl⸮k⸮D6⸮⸮Z⸮<⸮⸮Direction: Backward. Count: 38
Direction: Backward. Count: 82
Direction: Backward. Count: 0
Direction: Backward. Count: 52
@kd8bxp
kd8bxp / ESP32chip_id
Created September 18, 2017 01:14
Create a Unique MQTT Client ID or SSID for your ESP32 using part of the MAC address.
#include <WiFi.h>
#include <ESP32WebServer.h>
void setup()
{
Serial.begin(9600);
delay(10);
uint64_t chipid=ESP.getEfuseMac();//The chip ID is essentially its MAC address(length: 6 bytes).
@kd8bxp
kd8bxp / esp8266chip_id
Created September 18, 2017 01:07
Create a Unique MQTT Client ID or SSID for your ESP8266 using part of the MAC address.
void setup() {
Serial.begin(9600);
Serial.println("");
Serial.println("");
Serial.println("Check ID in:");
Serial.println("https://www.wemos.cc/verify_products");
Serial.printf("Chip ID = %08X\n", ESP.getChipId());
Serial.println(ESP.getChipId());
Serial.println("");
Serial.println("");