Skip to content

Instantly share code, notes, and snippets.

View w4ilun's full-sized avatar
🤖

w4ilun w4ilun

🤖
View GitHub Profile
#include "MIDIUSB.h"
#include <Adafruit_NeoPixel.h>
#define NEO_PIN 7
#define NUM_PXL 32
#define debounceDelay 5
//button states for debouncing
int state = 0;
int prev_state = 0;
@w4ilun
w4ilun / firmata.sh
Created April 11, 2017 01:14
Shell script using dfu-til for flashing the Arduino 101 with Firmata. Same commands used in IMRAA
#!/bin/sh
/usr/bin/dfu-util -d ,8087:0ABA -D /usr/share/mraa/firmata101.ino.bin -v -a 7 -R
http://production.shippingapis.com/ShippingAPI.dll?API=TrackV2&XML=<?xml version="1.0" encoding="UTF-8" ?><TrackRequest USERID="xxxxxxxx"><TrackID ID="EJ123456780US"></TrackID><TrackID ID="EJ123456781US"></TrackID><TrackID ID="12345"></TrackID></TrackRequest>
@w4ilun
w4ilun / install.sh
Last active June 30, 2022 05:49
RealTek WiFi rtl8723be driver installation
sudo apt-get install linux-headers-generic build-essential git
git clone https://github.com/lwfinger/rtlwifi_new.git
cd rtlwifi_new
make
sudo make install
sudo modprobe rtl8723be
ifconfig wlp2s0 up
//BLE
let service = 0xBEEF;
let characteristic = 0xFEED;
let byteLength = 20;
//IMU global vars for processing
let yaw = 0.0;
let pitch = 0.0;
let roll = 0.0;
window.onload = () => {
#include <CurieBLE.h>
#include <CurieIMU.h>
#include <MadgwickAHRS.h>
BLEPeripheral blePeripheral;
BLEService imuService("BEEF"); //give your custom service an ID
BLECharacteristic imuChar("FEED", BLERead | BLENotify, 20); //give your custom characteristic an ID, properties, and length
Madgwick filter;
unsigned long microsPerReading, microsPrevious;
@w4ilun
w4ilun / adc2.js
Created September 30, 2016 20:48
var mraa = require('mraa');
var version = mraa.getVersion();
if (version >= 'v0.6.1') {
console.log('mraa version (' + version + ') ok');
}
else {
console.log('mraa version(' + version + ') is old - this code may not work')
}
@w4ilun
w4ilun / adc.js
Created September 30, 2016 20:47
var mraa = require('mraa');
var version = mraa.getVersion();
if (version >= 'v0.6.1') {
console.log('mraa version (' + version + ') ok');
}
else {
console.log('mraa version(' + version + ') is old - this code may not work')
}
String response =
"HTTP/1.1 200 OK\r\n"
"CACHE-CONTROL: max-age=86400\r\n"
"DATE: Fri, 15 Apr 2016 04:56:29 GMT\r\n"
"EXT:\r\n"
"LOCATION: http://" + String(s) + ":80/setup.xml\r\n"
"OPT: \"http://schemas.upnp.org/upnp/1/0/\"; ns=01\r\n"
"01-NLS: b9200ebb-736d-4b93-bf03-835149d13983\r\n"
"SERVER: Unspecified, UPnP/1.0, Unspecified\r\n"
"ST: urn:Belkin:device:**\r\n"
https://api.github.com/repos/:accountname/:reponame/contents/:path