Skip to content

Instantly share code, notes, and snippets.

View MZachmann's full-sized avatar

Mark Zachmann MZachmann

  • Chapel Hill, NC
View GitHub Profile
@MZachmann
MZachmann / LoRaE5Test.c
Last active October 18, 2022 13:10
A simple LoRa ping-pong application for the LoRa-E5 module by Seeed Studio
/*
* Copyright (c) 2022 Mark Zachmann
* Merged blinky, lora\receive, and lora\send from the Zephyr samples
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/device.h>
#include <zephyr/drivers/lora.h>
#include <errno.h>
/*
This is a library written for the VEML6075 UVA/UVB/UV index Sensopr
SparkFun sells these at its website: www.sparkfun.com
Do you like this library? Help support SparkFun. Buy a board!
https://www.sparkfun.com/products/14748
Written by Jim Lindblom @ SparkFun Electronics, May 23, 2018
The VEML6075 senses UVA and UVB light, which allows for a calculation
of the UV index.
// GATT Battery Service
// MZachmann 2020
// MIT License
// this is the gatt standard battery level indicator
// it may send a notification when the battery level is set
#include <bluetooth/bluetooth.h>
#include <bluetooth/conn.h>
#include <bluetooth/gatt.h>
#include <bluetooth/uuid.h>
// GATT Device Information Service
// Copyright 2020 MZachmann
// MIT License
#include <bluetooth/bluetooth.h>
#include <bluetooth/hci.h>
#include <bluetooth/conn.h>
#include <bluetooth/uuid.h>
#include <bluetooth/gatt.h>
#include "BlueSub.h"
#include "../AppInclude.h"
#if USE_BLUETOOTH
#pragma message "Using bluetooth"
#include <bluetooth/bluetooth.h>
#include <bluetooth/hci.h>
#include <bluetooth/uuid.h>
#include <bluetooth/gatt.h>
@MZachmann
MZachmann / QspiFstore.c
Last active November 30, 2020 15:13
Simple qspi test code for littlefs implementation with nrf52840
/* test code for the qspi flash filesystem API with littlefs
* these were originally from zephyr sample apps
* so...
* Copyright (c) 2019 Peter Bigot Consulting, LLC
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr.h>
#include <stdio.h>
@MZachmann
MZachmann / server.ts
Last active February 5, 2020 12:14
A simple Node.js application to dump the icons of the Material Design Icons font
import http = require('http');
var port = process.env.port || 1337
// this just dumps characters 61400...65600 and 0xf0000...0xf0300 of the Material Design Icons font
// that's where the icons are stored.
var UseHex: boolean = true; // set to true for hexadecimal indices, false for decimal
// print a chunk of the dictionary into the server response
function PrintChunk(res: http.ServerResponse, start: number, length:number)
@MZachmann
MZachmann / AnalogIn.c
Last active June 3, 2024 11:45
Analog input for Zephyr
#include "AnalogIn.h"
#include <drivers/adc.h>
#include <string.h>
// Simple analog input method
// this just reads a sample then waits then returns it
// ADC Sampling Settings
// doc says that impedance of 800K == 40usec sample time
@MZachmann
MZachmann / TransmitTest.grc
Last active April 24, 2019 00:00
Gnu Radio Definition for Transceiver Testing
<?xml version='1.0' encoding='utf-8'?>
<?grc format='1' created='3.7.11'?>
<flow_graph>
<timestamp>Tue May 8 09:47:18 2018</timestamp>
<block>
<key>options</key>
<param>
<key>author</key>
<value></value>
</param>
@MZachmann
MZachmann / LoraPingPong.ino
Last active March 16, 2018 02:13
LoRa High Level Examples using LightLora
include "LoraUtil.h"
unsigned long _SendTime = 0;
unsigned long _SendInterval = 10000; // 10 seconds allowed for send
int packetnum = 0; // packet counter
setup()
{
_Lru = new LoraUtil();
}