This file contains hidden or 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
/********************************************************************* | |
This is an example for our Monochrome OLEDs based on SH110X drivers | |
This example is for a 128x64 size display using I2C to communicate | |
3 pins are required to interface (2 I2C and one reset) | |
Adafruit invests time and resources providing this open source code, | |
please support Adafruit and open-source hardware by purchasing | |
products from Adafruit! |
This file contains hidden or 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 <SD.h> | |
#define SD_CS_PIN 0 // Chip Select (CS) pin for SD card (GPIO0) | |
void setup() { | |
// Initialize serial communication for debugging | |
Serial.begin(115200); | |
while (!Serial); |
This file contains hidden or 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
#define TEMT6000_PIN 1 // GPIO pin connected to the TEMT6000X01 sensor | |
void setup() { | |
// Start the serial communication | |
Serial.begin(115200); | |
while (!Serial); | |
// Configure the analog pin | |
pinMode(TEMT6000_PIN, INPUT); | |
} |
This file contains hidden or 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
#define MIC_PIN 5 // GPIO 5 is connected to the microphone | |
void setup() { | |
// Start serial communication for debugging | |
Serial.begin(115200); | |
while (!Serial); | |
// Configure GPIO 5 as input for the microphone signal | |
pinMode(MIC_PIN, INPUT); | |
} |
This file contains hidden or 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
// the setup function runs once when you press reset or power the board | |
void setup() { | |
// initialize digital pin LED_BUILTIN as an output. | |
pinMode(19, OUTPUT); | |
} | |
// the loop function runs over and over again forever | |
void loop() { | |
digitalWrite(19, HIGH); // turn the LED on (HIGH is the voltage level) | |
delay(1000); // wait for a second |
This file contains hidden or 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> | |
#define SDA_PIN 4 // SDA pin connected to GPIO 04 | |
#define SCL_PIN 3 // SCL pin connected to GPIO 03 | |
void setup() { | |
// Start serial communication for debugging | |
Serial.begin(115200); | |
while (!Serial); |
This file contains hidden or 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 <EEPROM.h> | |
#define EEPROM_SIZE 512 // Size of the EEPROM (in bytes) | |
#define CS_PIN 10 // Chip Select (CS) pin for SPI flash (GPIO10) | |
void setup() { | |
// Initialize serial communication for debugging | |
Serial.begin(115200); | |
while (!Serial); |
This file contains hidden or 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 <Adafruit_Sensor.h> | |
#include <Adafruit_BME280.h> // Include the Adafruit BME280 library | |
#define SDA_PIN 4 // SDA pin connected to GPIO 04 | |
#define SCL_PIN 3 // SCL pin connected to GPIO 03 | |
#define BME280_ADDRESS 0x76 // Specify the I2C address of the BME280 sensor | |
Adafruit_BME280 bme; // Create an instance of the BME280 sensor |
This file contains hidden or 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
byte encodebool(boolean* arr) | |
{ | |
byte val = 0; | |
for (int i = 0; i<4; i++) | |
{ | |
val <<= 1; | |
if (arr[i]) val |= 1; | |
} | |
return val; | |
} |
This file contains hidden or 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
boolean dip_switch[4]; | |
dip_switch[0] = digitalRead(3); | |
dip_switch[1] = digitalRead(4); | |
dip_switch[2] = digitalRead(5); | |
dip_switch[3] = digitalRead(6); |
NewerOlder