Skip to content

Instantly share code, notes, and snippets.

View deldrid1's full-sized avatar

Austin Eldridge deldrid1

  • FareDrop
  • Knoxville, TN
View GitHub Profile
<!doctype html>
<html lang='en'>
<head>
<title></title>
<link href='https://cdn.jsdelivr.net/npm/mapbox-gl@1/dist/mapbox-gl.css' rel='stylesheet'>
<script src='https://cdn.jsdelivr.net/npm/mapbox-gl@1'></script>
</head>
<body>
<div id='map' style='width: 2304px; height: 1728px;'></div>
<script>
@deldrid1
deldrid1 / basic.usb.device.nut
Last active November 16, 2016 19:00 — forked from ElectricImpSampleCode/basic.usb.device.nut
Electric Imp imp API usb.configure() example
function processUSB(type, details) {
// Function called in response to a USB bus event
switch (type) {
case USB_DEVICE_CONNECTED:
local descriptors = details.descriptors;
server.log("USB device " + descriptors.product + " connected at speed " + details.speed + "Mbps");
server.log(format("USB = 0x%04x", descriptors.usb));
server.log(format("class = 0x%02x", descriptors["class"]));
server.log(format("subclass = 0x%02x", descriptors.subclass));
server.log(format("protocol = 0x%02x", descriptors.protocol));
@deldrid1
deldrid1 / Squirrel Modbus CRC's
Last active January 21, 2024 09:33
Two different Methods for calculating Modbus CRC's using the Electric Imp.
//Two Different methods of calculating Modbus's CRC16
//You can use http://www.lammertbies.nl/comm/info/crc-calculation.html to verify the calculation. Change Input Mode to Hex and input the string "0103" This is for Modbus CRC's.
imp.configure ("CRC Calculation", [], []);
server.log("============ PROGRAM START =============")
/*******************************************************************************
HELPER FUNCTIONS
*******************************************************************************/
function byteArrayString(arr){
local str = ""