https://microcontrollerslab.com/esp32-heart-rate-pulse-oximeter-max30102/
Sunday, January 7, 2024
Tuesday, December 26, 2023
BLE on ESP32
reference: https://forum.arduino.cc/t/startadvertising-is-not-a-member-of-bledevice/1086837/5
So change this part of your sketch:
#include <BLEDevice.h>
#include <BLEUtils.h>
#include <BLEServer.h>
#include <BLE2902.h>
to this:
#include <BLE2902.h>
#include <BLEDevice.h>
#include <BLEUtils.h>
#include <BLEServer.h>
Friday, July 28, 2023
Wednesday, March 22, 2023
PN532 nfc reader on Arduino
https://how2electronics.com/interfacing-pn532-nfc-rfid-module-with-arduino/
Tested both versions of connection - SPI & IIC which both worked. Needed to pay attention to comment and uncomment the definition for the nfc:
// Or use this line for a breakout or shield with an I2C connection:
Adafruit_PN532 nfc(PN532_IRQ, PN532_RESET); // seem these IRQ and reset pin assignments doesn't matter of IIC setup
Thursday, March 3, 2022
Reading HEX from SD card and updating the neopixel display
/*
the following is modified from SD card file dump
This sketch shows how to read some data from a file in the SD card using the
SD library and update an array of ledMat.
The circuit:
SD card attached to SPI bus as follows:
** MOSI - pin 11
** MISO - pin 12
** CLK - pin 13
** CS - pin 4 (for MKRZero SD: SDCARD_SS_PIN)
created 22 December 2010
by Limor Fried
modified 9 Apr 2012
by Tom Igoe
modified 3 Mar 2022
by Jeszki
*/
#include <SPI.h>
#include <SD.h>
#include <FastLED.h>
#define DATA_PIN 6
#define LED_TYPE NEOPIXEL
#define COLOR_ORDER GRB
#define NUM_LEDS 128
CRGB ledMat[NUM_LEDS];
const int chipSelect = 4;
void setup() {
// Open serial communications and wait for port to open:
FastLED.addLeds<WS2812, DATA_PIN, COLOR_ORDER>(ledMat, NUM_LEDS);
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
Serial.print("Initializing SD card...");
// see if the card is present and can be initialized:
if (!SD.begin(chipSelect)) {
Serial.println("Card failed, or not present");
// don't do anything more:
while (1);
}
Serial.println("card initialized.");
// open the file. note that only one file can be open at a time,
// so you have to close this one before opening another.
File dataFile = SD.open("test.bin"); //just a text file
// if the file is available, write to it:
if (dataFile) {
int x = 0;
while (dataFile.available()) {
char x1 = dataFile.read();
char x2 = dataFile.read();
char x3 = dataFile.read();
Serial.print(x1,HEX);
Serial.print(x2,HEX);
Serial.print(x3,HEX);
if (((x+1)%16)==0) { Serial.println();} // print 16 char on 1 line
ledMat[x++]= CRGB(x1,x2,x3);
}
dataFile.close();
}
// if the file isn't open, pop up an error:
else {
Serial.println("error opening datalog.txt");
}
FastLED.show();
delay(100);
}
void loop() {
}
Wednesday, March 2, 2022
Use union to convert long to bytes
// reference: https://forum.arduino.cc/t/solved-splitting-and-rebuilding-of-long-data-type-numbers/606975/3
//..\Union Example\union_example.ino
// doesn't work on Leonardo but could work on Nano
//
typedef union u_conv
{
long lValue;
byte lByte[4];
};
u_conv
strt,
finish;
void setup()
{
Serial.begin(9600);
strt.lValue = 2147483643;
Serial.println("Original values:");
Serial.println(strt.lValue, DEC);
Serial.println(strt.lValue, BIN);
//send start.lByte[0..3] to storage medium
//
//here, the retrieval is simulated by copying the byte values from the "strt" union
//to the corresponding byet values in the "finish" union
//
//in use, you'd retrieve the bytes from storage and put them in a destination union
for( int i=0; i<4; i++ )
finish.lByte[i] = strt.lByte[i];
Serial.println("Processed values:");
Serial.println(finish.lValue, DEC);
Serial.println(finish.lValue, BIN);
}//setup
void loop()
{
}//loop
Thursday, October 28, 2021
esp32cam
Based on the setup in the following link:
https://how2electronics.com/esp32-cam-based-object-detection-identification-with-opencv/
1. open example -> esp32cam -> WifiCam
2. update AP
3. tested working
Next, try combine with wifimanagerExample