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 <ESP8266WiFi.h> | |
#include <PubSubClient.h> | |
#include <string.h> | |
// Update with values suitable for your network. | |
const char* mqtt_server = "pine64"; | |
WiFiClient espClient; | |
PubSubClient client(espClient); | |
long lastMsg = 0; |
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
#!/bin/bash | |
# See https://github.com/pfeerick/pine64-scripts/blob/master/pine64-battery-colour.sh | |
# for updated versions of this script. | |
SWITCH="\033[" | |
NORMAL="${SWITCH}0m" | |
RED="${SWITCH}1;31m" | |
GREEN="${SWITCH}1;32m" | |
YELLOW="${SWITCH}1;33m" |
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
#!/bin/bash | |
#elevate to root to ensure no permission errors | |
#[ `whoami` = root ] || exec su -c $0 root | |
if [[ $EUID -ne 0 ]]; then | |
echo "i2cset usually needs sudo powers to run, please login if prompted to avoid permission errors" | |
exec sudo $0 | |
fi | |
echo "Set all Port A pins (GPA0-7) as outputs..." |
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
#!/bin/bash | |
function openGPIO | |
{ | |
#test if GPIO sysfs entry exists, create if necessary | |
if [ ! -e "/sys/class/gpio/gpio359" ]; then | |
# echo "DEBUG: export 359" | |
echo 359 > "/sys/class/gpio/export" | |
fi |
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 "nRF24L01.h" | |
#include "RF24.h" | |
//needed for printDetails | |
#define printf Serial.printf | |
#define sprintf(...) os_sprintf( __VA_ARGS__ ) | |
#define CE_PIN 10 | |
#define CSN_PIN 5 |
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
/* | |
Just s simple script to test some particle stuff on the Oak | |
*/ | |
// this makes the Oak only automatically connect to wifi, not particle | |
SYSTEM_MODE(SEMI_AUTOMATIC) | |
// the setup function runs once when you reset or power the board | |
void setup() | |
{ |
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 <ESP8266WiFi.h> | |
#include <PubSubClient.h> | |
#include <string.h> | |
// Update with values suitable for your network. | |
const char* mqtt_server = "pine64"; | |
WiFiClient espClient; | |
PubSubClient client(espClient); | |
long lastMsg = 0; |
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 <ESP8266WiFi.h> | |
#include <WiFiClient.h> | |
#include <ESP8266WebServer.h> | |
#include <ESP8266mDNS.h> | |
#include <SPI.h> | |
#include "nRF24L01.h" | |
#include "RF24.h" | |
#include <elapsedMillis.h> |
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
/* | |
Door Monitor | |
Monitors a reed switch for an open door, and posts to particle. | |
Created 2 June 2016 | |
Updated 17th October | |
by Peter Feerick | |
*/ | |
const int LED_PIN = 1; //The LED is connected to P1 on the Oak |
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
//SEMI_AUTOMATIC mode to ensure variable is available | |
//Probably isn't needed if you don't use Particle.variable in your code | |
SYSTEM_MODE(SEMI_AUTOMATIC); | |
#include <ESP8266WiFi.h> | |
char myIpString[24]; | |
IPAddress myIp; | |
void setup() |
OlderNewer