Skip to content

Instantly share code, notes, and snippets.

@yavor87
yavor87 / ESP8266.ino
Last active May 21, 2016 09:58
ESP8266 sensor server
#include <DHT.h>
#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>
#define DHTPIN 2
#define DHTTYPE DHT11
#define LEDPIN 14
ESP8266WebServer server(80);
DHT dht(DHTPIN, DHTTYPE);
@yavor87
yavor87 / buttonBlink.ino
Last active February 7, 2016 13:08
Example for TI MSP40 board. Will blink button on specific frequency depending on button presses.
@yavor87
yavor87 / androidPlayAudio.java
Last active August 3, 2023 21:40
Record, play and visualize raw audio data in Android
ShortBuffer mSamples; // the samples to play
int mNumSamples; // number of samples to play
void playAudio() {
new Thread(new Runnable() {
@Override
public void run() {
int bufferSize = AudioTrack.getMinBufferSize(SAMPLE_RATE, AudioFormat.CHANNEL_OUT_MONO,
AudioFormat.ENCODING_PCM_16BIT);
if (bufferSize == AudioTrack.ERROR || bufferSize == AudioTrack.ERROR_BAD_VALUE) {