Skip to content

Instantly share code, notes, and snippets.

View J3698's full-sized avatar
🐛
Inch Worm

Anti J3698

🐛
Inch Worm
  • Working
  • Working
View GitHub Profile
@J3698
J3698 / UnoBluetooth.ino
Created July 21, 2018 23:43
Using both the Serial Monitor and a Bluetooth module on RX/TX
void setup() {
String debug = "";
// Begin the serial monitor
Serial.begin(115200);
/*
I use delays to ensure certain things
have had time to settle and for
debugging - some are probably extraneous
*/
@J3698
J3698 / Settings.ino
Last active July 22, 2018 00:42
Send and retrieve the Bluetooth module's settings
void setup() {
// Start the serial monitor
/*
Note: make sure the serial monitor's
baud rate is set to 115,200
*/
Serial.begin(115200);
// Start communication with the Bluetooth module
Serial1.begin(115200);
@J3698
J3698 / auto-bt.sh
Last active April 15, 2019 00:57
Automatically accept incoming bluetooth connections
#!/usr/bin/env bash
amixer -c 0 cset numid=3
coproc stdbuf -oL bluetoothctl
sleep 7
sudo -u pi pulseaudio --start
echo -e "pairable on\n" >& ${COPROC[1]}
echo -e "discoverable on\n" >& ${COPROC[1]}
echo -e "agent NoInputNoOutput\n" >& ${COPROC[1]}
@J3698
J3698 / viz.sh
Last active December 31, 2018 20:53
Startup script for auto connect bt
#!/usr/bin/env bash
amixer -c 0 cset numid=3 1
/home/pi/auto-bt.sh &
#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
#include <errno.h>
#include <unistd.h>
#include <math.h>
#include <getopt.h>
#include <string.h>
#include <wchar.h>
#include <locale.h>
@J3698
J3698 / metro.c
Created February 24, 2019 01:43
Metronome Example Program
/*
Copyright (C) 2002 Anthony Van Groningen
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 2 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
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@J3698
J3698 / first_test.c
Last active March 2, 2019 01:19
First Program in Jack
#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
#include <errno.h>
#include <unistd.h>
#include <string.h>
#include <jack/jack.h>
#include <jack/transport.h>
@J3698
J3698 / auto-bt-top-old.sh
Last active April 29, 2019 00:43
Old Version of Top of auto-bt.sh
#!/usr/bin/env bash
amixer -c 0 cset numid=3
coproc stdbuf -oL bluetoothctl
sleep 5
sudo -u pi pulseaudio --start
@J3698
J3698 / auto-bt.sh
Last active April 29, 2019 00:57
New version of auto-bt.sh
#!/usr/bin/env bash
coproc stdbuf -oL bluetoothctl
sleep 5
sudo -u pi /usr/local/bin/jackd -dalsa -r44100 -p1024 -n2 &
sleep 10
sudo -u pi pulseaudio --start
echo "Started Jackd"
@J3698
J3698 / auto-bt-top-new.sh
Last active April 29, 2019 00:44
Version 2 of Top of auto-bt.sh
#!/usr/bin/env bash
amixer -c 0 cset numid=3
coproc stdbuf -oL bluetoothctl
sleep 5
sudo -u pi /usr/local/bin/jackd -dalsa -r44100 -p1024 -n2 &
sleep 10
sudo -u pi pulseaudio --start