View VS1053B_Adafruit_playback.ino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SPI.h> | |
#include <Wire.h> | |
#include <VS1053.h> | |
#include "SampleMp3.h" | |
// These are the pins used for the breakout example | |
#define BREAKOUT_RESET 9 // VS1053 reset pin (output) | |
#define BREAKOUT_CS 10 // VS1053 chip select pin (output) | |
#define BREAKOUT_DCS 6 // VS1053 Data/command select pin (output) | |
#define CARDCS 4 // Card chip select pin |
View main.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <WiFi.h> | |
#include <HTTPClient.h> | |
// WiFi network name and password: | |
const char * networkName = "your-ssid"; | |
const char * networkPswd = "your-password"; | |
// Internet address to send POST data to | |
const char * hostDomain = "10.13.37.158"; | |
const int hostPort = 3001; |
View ArduinoStringSep.ino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String getValue(String data, char separator, int index) | |
{ | |
int found = 0; | |
int strIndex[] = { 0, -1 }; | |
int maxIndex = data.length() - 1; | |
for (int i = 0; i <= maxIndex && found <= index; i++) { | |
if (data.charAt(i) == separator || i == maxIndex) { | |
found++; | |
strIndex[0] = strIndex[1] + 1; |
View index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="en" data-theme="dark"/> | |
<head> | |
<meta charset="utf-8"> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/paho-mqtt/1.0.1/mqttws31.min.js" type="text/javascript"></script> | |
<script src="./secret.js" type="text/javascript"></script> | |
<script src="./mqtt.js" type="text/javascript"></script> | |
<title>MQTT Demo</title> | |
<link rel="stylesheet" href="https://unpkg.com/@picocss/pico@latest/css/pico.min.css"> | |
</head> |
View mqtt.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const myTopic = "users/jensa/led"; | |
const myServer = "mqtt.toytronics.com"; | |
const client = new Paho.MQTT.Client(myServer,8883, "myClientId" + new Date().getTime()); | |
client.onConnectionLost = onConnectionLost; | |
client.onMessageArrived = onMessageArrived; | |
console.log("Start connection!"); | |
var connectOptions = { |
View gist:c0d2d5df453742a9af9ee97484cc0877
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int sensorPin = 0; | |
void setup() | |
{ | |
Serial.begin(9600); | |
} | |
void loop() | |
{ | |
View HK_Feather.ino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Arduino.h> | |
#include <Wire.h> | |
#include <i2cdetect.h> | |
#include <Adafruit_LIS3DH.h> | |
#include <Adafruit_Sensor.h> | |
#include <Adafruit_DotStar.h> | |
#include "Adafruit_SHT31.h" | |
#include "Adafruit_LTR329_LTR303.h" | |
// There is only one pixel on the board |
View dweetio.ino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <WiFi.h> | |
/* | |
* Basic code for setting a Dweet with a GET request on an ESP32 | |
* | |
* Original by Liz Miller (www.learnrobotics.org) | |
* Updated for ESP32 by https://gist.github.com/jenschr | |
*/ | |
// WiFi parameters | |
const char* ssid = "your-ssid"; // Replace with your ssid |
View AWS Camera test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "esp_http_client.h" | |
#include "esp_camera.h" | |
#include <WiFi.h> | |
#include "Arduino.h" | |
#include "Base64.h" | |
#include "mbedtls/base64.h" | |
#include <NTPClient.h> | |
#include <WiFiUdp.h> | |
View Subscriber.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { useSubscription } from 'mqtt-react-hooks'; | |
export default function Subscriber() { | |
/* Message structure: | |
* topic: string | |
* message: string | |
*/ | |
const { message } = useSubscription([ |
NewerOlder