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 <Wire.h> | |
#include <i2cdetect.h> | |
void setup() { | |
// The Oled screen won't be visible unless we set the RESET line on the screen high | |
pinMode (16, OUTPUT); | |
digitalWrite (16, HIGH); // while OLED is running, GPIO16 must go high | |
// Rather than | |
Wire.begin(4, 15); |
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
/* | |
* Simple example showcasing how to publish data from the HiGrow board to Thingspeak | |
* For this to work, you'll need to create a file called "secrets.h" that holds the | |
* credentials you find on Thingspeak. These 4 lines are what is required in secrets.h | |
* | |
* #define SECRET_CH_ID 1234 | |
* #define SECRET_WRITE_APIKEY "KLLJNKLJHGI" | |
* #define SECRET_SSID "yourssid" | |
* #define SECRET_PASS "yourpasswd" | |
* |
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
/* | |
* Arduino example for using the HiGrow board based on ESP32 as a server, so you can check in on your plant to see how it's doing | |
* | |
* Details on the hardware and how to use it can be found on: | |
* http://flashgamer.com/blog/comments/higrow-esp32-moisture-and-temperature-sensor#capacitive | |
*/ | |
#include "DHT.h" | |
#include <WiFi.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
/* | |
* Very basic Arduino example for testing the HiGrow board based on ESP32, DHT11 and a capacitive moisture sensor | |
* | |
* Details on the hardware and how to use it can be found on: | |
* http://flashgamer.com/blog/comments/higrow-esp32-moisture-and-temperature-sensor#capacitive | |
*/ | |
#include "DHT.h" | |
#define DHTTYPE DHT11 |
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 <OneWire.h> | |
int DS18S20_Pin = 2; //DS18S20 Signal pin on digital 2 | |
//Temperature chip i/o | |
OneWire ds(DS18S20_Pin); // on digital pin 2 | |
void setup(void) { | |
Serial.begin(9600); | |
} |
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
/* | |
* Simplified code for running APA-102 on STM32 | |
* (or most any other platform by replacing the | |
* sendRaw-method with platform SPI calls) | |
*/ | |
#define NUMBER_OF_LEDS 46 // Define number of LEDs in the chain | |
#define COLORS_PER_LED 3 // Define number of colors we store | |
const int bufferLength = NUMBER_OF_LEDS*3; |
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
/** | |
**=========================================================================== | |
** Notes during development of this tiny Blink program | |
** - Blinking a LED isn't easy unless you know exactly what libraries you | |
** need to include & what registers to set. The simplest way is to try | |
** setting as much as possible up using CubeMX. This will add all the | |
** needed HAL files for GPIO | |
** - You need to learn how to clear breakpoints since Atollic TrueStudio will | |
** place them in random parts of your code at times. This will case debug | |
** to stop working. If you get this error: |
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
/******************************************************************************* | |
* Copyright (c) 2015 Thomas Telkamp and Matthijs Kooijman | |
* Copyright (c) 2018 Terry Moore, MCCI | |
* | |
* Permission is hereby granted, free of charge, to anyone | |
* obtaining a copy of this document and accompanying files, | |
* to do whatever they want with them without any restriction, | |
* including, but not limited to, copying, modification and redistribution. | |
* NO WARRANTY OF ANY KIND IS PROVIDED. | |
* |
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
// Open Serial Monitor after uploading and make sure it's set to 57600baud | |
// Check that you get "OK" in the serial monitor after "BT ready?" | |
// Remember to turn on CR + Newline nat the bottom of the Serial Monitor | |
// Type in "AT+NAME:yourName" in input-field of your Serial monitor | |
SoftwareSerial mySerial(10, 11); // RX, TX | |
void setup() { | |
// Open serial communications and wait for port to open: | |
Serial.begin(57600); |
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
unsigned long sensorValue = particleSensor.getIR(); | |
if ( sensorValue > 50000) | |
{ | |
if ( usePlotter ) | |
{ | |
Serial.println(sensorValue); //Send raw data to plotter | |
} else { | |
int diff = lastSensorValue - sensorValue; | |
if ( diff > 80 ) // we may have a beat! | |
{ |