Skip to content

Instantly share code, notes, and snippets.

console.log('hello')
import struct from "../struct.mjs";
function toArrayBuffer(buf) {
const ab = new ArrayBuffer(buf.length);
const view = new Uint8Array(ab);
for (let i = 0; i < buf.length; ++i) {
view[i] = buf[i];
}
return ab;
// Output sine wave with frequency sweep between 100Hz and 10kHz (32 samples) on analog pin A0 using the DAC and DMAC
// Generously initially donated by MartinL2
// Written for M0. Tested on Adafruit Feather M0 with ATWINC-1500 WiFi
//
// BDL change to 100Hz to 25000Hz
// BDL change to sweep in frequency, rather than period. This makes it look better on an FFT
// BDL change to have constant power in FFT bins. Each frequency operates for the same amount of time yielding constant
// power in the FFT
// Uploaded to Adafruit forum 17 July 2019
#include <U8x8lib.h>
#include <LoRa.h>
String receivedText;
String receivedRssi;
// WIFI_LoRa_32 ports
// GPIO5 -- SX1278's SCK
// GPIO19 -- SX1278's MISO
// GPIO27 -- SX1278's MOSI
@dwblair
dwblair / zerosleep.ino
Created September 15, 2020 14:55
using moteino example + rfm95 sleep() to see how low we can get feather m0 lora to sleep ...
#include <RTCZero.h>
#include <SPI.h>
#include <RH_RF95.h>
// for feather m0
#define RFM95_CS 8
#define RFM95_RST 4
#define RFM95_INT 3
#include "WiFi.h"
#include <U8x8lib.h>
// the OLED used
U8X8_SSD1306_128X64_NONAME_SW_I2C u8x8(/* clock=*/ 15, /* data=*/ 4, /* reset=*/ 16);
void setup()
{
// Set WiFi to station mode and disconnect from an AP if it was previously connected
@dwblair
dwblair / postgres_instructions.MD
Last active August 23, 2021 02:37
Setting up postgres in ubuntu

installing postgresql on ubuntu

Install postgres

sudo apt install postgresql postgresql-contrib

Set password for user postgres

#include <WiFi.h>
#include <HTTPClient.h>
#include <ArduinoJson.h>
const char* ssid = "YOURSSID";
const char* password = "YOURPASSWORD";
//Your Domain name with URL path or IP address with path
#include "HX711.h"
// HX711.DOUT - pin #A1
// HX711.PD_SCK - pin #A0
HX711 scale(A1, A0); // parameter "gain" is ommited; the default value 128 is used by the library
float force_max = 0.;
void setup() {
#!/bin/bash
for i in {1..1000}
do
echo 'post ...'
curl --location --request PUT 'http://159.65.226.222:3000/api/drives/59a0cab6d6faa75e205a52522bcaa255e1d3bcede4b52b85bc899534f6792e4b' --header 'Authorization: 41c29b4d120993dfb0bbc2a0e2f3b63ba0d28a99433a06e9bd3bf025743c62a7' --header 'Content-Type: application/json' --data-raw '{"deviceId":"sensor1","fields":{"temp":20.3, "humid":10}}'
sleep 1
done

We are a small collective aiming to connect grassroots movements with academia and everyone who is looking for an alternative way of living. To achieve this goal, we arebegninng by conducting interviews with activists, open and libre innovative organizations ... and anyone with ideas on how to create a better world.

In the future we would like to conduct research motivated intrinsically, following our values to solve problems and without pressure to publish as much as possible -- research of high quality, but pursued without being driven by academic reputation or particular sources of funding. We dream of establishing an institute which is non-hierarchical, open-minded, and focused on peer-learning.

In addition to interviews and research projects, we would also like to focus on teaching and dissemintation -- through workshops, as well as through an online magazine. Our concept for such a magazine invovles short reviews, news, and interviews, as well as longer-form reports and analyses on topics we would li