Skip to content

Instantly share code, notes, and snippets.

View sjfricke's full-sized avatar

Spencer Fricke sjfricke

View GitHub Profile
@sjfricke
sjfricke / android.go
Last active September 5, 2017 14:31
adb shell setprop in Go
package main
import (
"fmt"
"os/exec"
"strings"
)
func run(args ...string) {
cmd := exec.Command("adb", args...)
@sjfricke
sjfricke / PocketSphinx-Dragonboard.md
Created November 17, 2017 06:53
How to get PocketSphinx to work on the Dragonboard

How to install PocketSphinx on Dragonboard Linaro

Tested on Linaro 4.9.39

Update board

  • sudo apt-get update
  • sudo apt-get upgrade
  • sudo apt-get install autoconf libtool automake bison python-dev swig libasound2-dev
@sjfricke
sjfricke / gpio.c
Last active January 18, 2018 13:33
Dragonboard 410c sysfs GPIO wrapper
#include "gpio.h"
uint16_t GpioDB410cMapping(uint16_t pin) {
// only pin 23-34
if (pin < 23 || pin > 34) {
printf("ERROR: Pin %d does not have a GPIO pin mapped\n", pin);
return 0;
}
switch(pin) {
@sjfricke
sjfricke / i2c.c
Created January 3, 2018 23:12
Dragonboard 410c I2C ioctl wrapper
#include "i2c.h"
// File handlers if all I2C
#define I2C_MAX_BUS_COUNT 4
// initalize every counter to zero
static int I2C_FH[I2C_MAX_BUS_COUNT];
// Keeps a refernce counter of all used FH
static int I2C_FH_RC[I2C_MAX_BUS_COUNT] = { 0 };
int I2cOpen(int bus) {
@sjfricke
sjfricke / wifi_scan.c
Created January 19, 2018 18:29
Dragonboard 410c script to scan the wifi around you and display information
/* apt install libiw-dev
* gcc wifi_scan.c -liw -o wifi_scan
* ./wifi_scan
*
* Docs: http://docs.ros.org/jade/api/heatmap/html/iwlib_8h.html
*/
#include <stdio.h>
#include <time.h>
#include <iwlib.h>
@sjfricke
sjfricke / Simple_HTML_Form.html
Created January 30, 2018 16:05
Pure HTML form of the most simplest form
<!DOCTYPE html>
<html>
<head>
<title>Simple HTML Form</title>
<style>
body {
text-align: center;
}
#main {
@sjfricke
sjfricke / config.txt
Last active February 25, 2022 18:15
Waveshare 4 inch HDMI LCD display for Raspberry Pi Quick Start - Append to /boot/config.txt
# Display Monitor Timings - DMT
hdmi_group=2
# CVT (coordinated video timings)
hdmi_mode=87
# hdmi_cvt=<width> <height> <framerate> <aspect> <margins> <interlace> <rb>
## width (required) width in pixels
## height (required) height in pixels
## framerate (required) framerate in Hz
@sjfricke
sjfricke / test.c
Created March 4, 2018 01:28
ads1115 demo test
// gcc test.c -lwiringPi -o test
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <wiringPi.h>
#include <ads1115.h>
#define MY_BASE 2222
#define JOY_RX 0
@sjfricke
sjfricke / accel.c
Last active March 4, 2018 06:27
Accelerometer sensor Grove kit
#include "accel.h"
void AccelSetup(int bus) {
uint8_t modeReg;
I2cOpen(bus);
I2cSetSlave(bus, 0x4c);
I2cReadByte(bus, MMA7660_REG_MODE, &modeReg);
@sjfricke
sjfricke / get_windows_wireless_pass.bat
Created May 18, 2018 09:49
Find the password to wireless network connected with Windows, replace <SSID> with network
netsh wlan show profile <SSID> key=clear | findstr "Key Content"