SparkFun_AS7265x_Arduino_Library
ArduinoJson
SparkFun_AS7265x_Arduino_Library | ArduinoJson | |
---|---|---|
7 | 24 | |
33 | 6,581 | |
- | - | |
3.7 | 8.8 | |
6 months ago | 1 day ago | |
C++ | C++ | |
GNU General Public License v3.0 or later | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
SparkFun_AS7265x_Arduino_Library
-
Combining 2 pcbs…
I need a PCB producing that encoroorates 2 existing pcbs. It is a combination of 2 open source boards. They are sparkfun thing plus esp-s2 https://www.sparkfun.com/products/17743 and a sensor board a sparkfun as7265x https://www.sparkfun.com/products/15050.
-
Issues using AS7265X Spectral sensor with Sparkfun esp32-s2 Thing Plus
/* Read the 18 channels of spectral light over I2C using the Spectral Triad By: Nathan Seidle SparkFun Electronics Date: October 25th, 2018 License: MIT. See license file for more information but you can basically do whatever you want with this code. This example takes all 18 readings and blinks the illumination LEDs as it goes. We recommend you point the Triad away from your eyes, the LEDs are *bright*. Feel like supporting open source hardware? Buy a board from SparkFun! https://www.sparkfun.com/products/15050 Hardware Connections: Plug a Qwiic cable into the Spectral Triad and a BlackBoard If you don't have a platform with a Qwiic connection use the SparkFun Qwiic Breadboard Jumper (https://www.sparkfun.com/products/14425) Open the serial monitor at 115200 baud to see the output */ #include "SparkFun_AS7265X.h" //Click here to get the library: http://librarymanager/All#SparkFun_AS7265X AS7265X sensor; #include void setup() { Serial.begin(115200); Serial.println("AS7265x Spectral Triad Example"); Serial.println("Point the Triad away and press a key to begin with illumination..."); while (Serial.available() == false) { } //Do nothing while we wait for user to press a key Serial.read(); //Throw away the user's button if (sensor.begin() == false) { Serial.println("Sensor does not appear to be connected. Please check wiring. Freezing..."); while (1) ; } sensor.disableIndicator(); //Turn off the blue status LED Serial.println("A,B,C,D,E,F,G,H,R,I,S,J,T,U,V,W,K,L"); } void loop() { sensor.takeMeasurementsWithBulb(); //This is a hard wait while all 18 channels are measured Serial.print(sensor.getCalibratedA()); //410nm Serial.print(","); Serial.print(sensor.getCalibratedB()); //435nm Serial.print(","); Serial.print(sensor.getCalibratedC()); //460nm Serial.print(","); Serial.print(sensor.getCalibratedD()); //485nm Serial.print(","); Serial.print(sensor.getCalibratedE()); //510nm Serial.print(","); Serial.print(sensor.getCalibratedF()); //535nm Serial.print(","); Serial.print(sensor.getCalibratedG()); //560nm Serial.print(","); Serial.print(sensor.getCalibratedH()); //585nm Serial.print(","); Serial.print(sensor.getCalibratedR()); //610nm Serial.print(","); Serial.print(sensor.getCalibratedI()); //645nm Serial.print(","); Serial.print(sensor.getCalibratedS()); //680nm Serial.print(","); Serial.print(sensor.getCalibratedJ()); //705nm Serial.print(","); Serial.print(sensor.getCalibratedT()); //730nm Serial.print(","); Serial.print(sensor.getCalibratedU()); //760nm Serial.print(","); Serial.print(sensor.getCalibratedV()); //810nm Serial.print(","); Serial.print(sensor.getCalibratedW()); //860nm Serial.print(","); Serial.print(sensor.getCalibratedK()); //900nm Serial.print(","); Serial.print(sensor.getCalibratedL()); //940nm Serial.print(","); Serial.println(); }
-
Modding advice for resin printers (changing light source)
SparkFun Triad Spectroscopy Sensor
-
Help: Please recommend a sensor that can convert light to frequency? And, if possible, where can I buy it (one that ships overseas)?
Edit: this looks like what you might want https://www.sparkfun.com/products/15050
- Open Source Plastic Scanner
-
Part2-A noob needs help on an advanced project ( Spectroscopy Sensor )
link for code used
-
A noob needs help on an advanced project ( Spectroscopy Sensor )
code: the same one from the library
ArduinoJson
- How can I obtain weather info?
-
Creating Pixel Art with Web Interface using ESP8266
I'm using the library ArduinoJson to storage arts in the ESP8266 memory at JSON format. But, i'm have difficult to storage more than 4 drawings, possibly because i don't know how scale, optimize and manager the memory space.
-
Question regarding ArduinoJson.h Connection
/******************************************************************* A sample project for making a HTTP/HTTPS GET request on an ESP32 and parsing it from JSON It will connect to the given request, parse the JSON and print the body to serial monitor Parts: ESP32 Dev Board Aliexpress: * - https://s.click.aliexpress.com/e/_dSi824B Amazon: * - https://amzn.to/3gArkAY * * = Affilate If you find what I do useful and would like to support me, please consider becoming a sponsor on Github https://github.com/sponsors/witnessmenow/ Written by Brian Lough YouTube: https://www.youtube.com/brianlough Tindie: https://www.tindie.com/stores/brianlough/ Twitter: https://twitter.com/witnessmenow *******************************************************************/ // ---------------------------- // Standard Libraries // ---------------------------- #include #include // ---------------------------- // Additional Libraries - each one of these will need to be installed. // ---------------------------- #include // Library used for parsing Json from the API responses // Search for "Arduino Json" in the Arduino Library manager // https://github.com/bblanchon/ArduinoJson //------- Replace the following! ------ char ssid[] = "yourSSID"; // your network SSID (name) char password[] = "yourPassword"; // your network key // For Non-HTTPS requests // WiFiClient client; // For HTTPS requests WiFiClientSecure client; // Just the base of the URL you want to connect to #define TEST_HOST "api.openweathermap.org" // Root cert of server we are connecting to // Baltimore CyberTrust Root - Expires 12 May 2025 // (FYI, from a security point of view you should not trust certs from other people, including me!) /*const char *server_cert = "-----BEGIN CERTIFICATE-----\n" "MIIDdzCCAl+gAwIBAgIEAgAAuTANBgkqhkiG9w0BAQUFADBaMQswCQYDVQQGEwJJ\n" "RTESMBAGA1UEChMJQmFsdGltb3JlMRMwEQYDVQQLEwpDeWJlclRydXN0MSIwIAYD\n" "VQQDExlCYWx0aW1vcmUgQ3liZXJUcnVzdCBSb290MB4XDTAwMDUxMjE4NDYwMFoX\n" "DTI1MDUxMjIzNTkwMFowWjELMAkGA1UEBhMCSUUxEjAQBgNVBAoTCUJhbHRpbW9y\n" "ZTETMBEGA1UECxMKQ3liZXJUcnVzdDEiMCAGA1UEAxMZQmFsdGltb3JlIEN5YmVy\n" "VHJ1c3QgUm9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKMEuyKr\n" "mD1X6CZymrV51Cni4eiVgLGw41uOKymaZN+hXe2wCQVt2yguzmKiYv60iNoS6zjr\n" "IZ3AQSsBUnuId9Mcj8e6uYi1agnnc+gRQKfRzMpijS3ljwumUNKoUMMo6vWrJYeK\n" "mpYcqWe4PwzV9/lSEy/CG9VwcPCPwBLKBsua4dnKM3p31vjsufFoREJIE9LAwqSu\n" "XmD+tqYF/LTdB1kC1FkYmGP1pWPgkAx9XbIGevOF6uvUA65ehD5f/xXtabz5OTZy\n" "dc93Uk3zyZAsuT3lySNTPx8kmCFcB5kpvcY67Oduhjprl3RjM71oGDHweI12v/ye\n" "jl0qhqdNkNwnGjkCAwEAAaNFMEMwHQYDVR0OBBYEFOWdWTCCR1jMrPoIVDaGezq1\n" "BE3wMBIGA1UdEwEB/wQIMAYBAf8CAQMwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3\n" "DQEBBQUAA4IBAQCFDF2O5G9RaEIFoN27TyclhAO992T9Ldcw46QQF+vaKSm2eT92\n" "9hkTI7gQCvlYpNRhcL0EYWoSihfVCr3FvDB81ukMJY2GQE/szKN+OMY3EU/t3Wgx\n" "jkzSswF07r51XgdIGn9w/xZchMB5hbgF/X++ZRGjD8ACtPhSNzkE1akxehi/oCr0\n" "Epn3o0WC4zxe9Z2etciefC7IpJ5OCBRLbf1wbWsaY71k5h+3zvDyny67G7fyUIhz\n" "ksLi4xaNmjICq44Y3ekQEe5+NauQrz4wlHrQMz2nZQ/1/I6eYs9HRCwBXbsdtTLS\n" "R9I4LtD+gdwyah617jzV/OeBHRnDJELqYzmp\n" "-----END CERTIFICATE-----\n"; */ void setup() { Serial.begin(115200); // Connect to the WiFI WiFi.mode(WIFI_STA); WiFi.begin(ssid, password); Serial.println(""); // Wait for connection while (WiFi.status() != WL_CONNECTED) { delay(500); Serial.print("."); } Serial.println(""); Serial.print("Connected to "); Serial.println(ssid); Serial.print("IP address: "); Serial.println(WiFi.localIP()); //-------- // Checking the cert is the best way on an ESP32 // This will verify the server is trusted. //client.setCACert(server_cert); // If you don't want to verify the server // Unlike the fingerprint method of the ESP8266 which expires frequently // the cert lasts years, so I don't see much reason to ever // use this on the ESP32 client.setInsecure(); } void makeHTTPRequest() { // Opening connection to server (Use 80 as port if HTTP) if (!client.connect(TEST_HOST, 443)) { Serial.println(F("Connection failed")); return; } // give the esp a breather yield(); // Send HTTP request client.print(F("GET ")); // This is the second half of a request (everything that comes after the base URL) client.print("/data/2.5/weather?q=London, UK&appid=[yourOpenWeatherAPI]&units=metric"); // %2C == , client.println(F(" HTTP/1.1")); //Headers client.print(F("Host: ")); client.println(TEST_HOST); client.println(F("Cache-Control: no-cache")); if (client.println() == 0) { Serial.println(F("Failed to send request")); return; } //delay(100); // Check HTTP status char status[32] = {0}; client.readBytesUntil('\r', status, sizeof(status)); if (strcmp(status, "HTTP/1.1 200 OK") != 0) { Serial.print(F("Unexpected response: ")); Serial.println(status); return; } // Skip HTTP headers char endOfHeaders[] = "\r\n\r\n"; if (!client.find(endOfHeaders)) { Serial.println(F("Invalid response")); return; } // This is probably not needed for most, but I had issues // with the Tindie api where sometimes there were random // characters coming back before the body of the response. // This will cause no hard to leave it in // peek() will look at the character, but not take it off the queue while (client.available() && client.peek() != '{') { char c = 0; client.readBytes(&c, 1); Serial.print(c); Serial.println("BAD"); } // // While the client is still availble read each // // byte and print to the serial monitor // while (client.available()) { // char c = 0; // client.readBytes(&c, 1); // Serial.print(c); // } //Use the ArduinoJson Assistant to calculate this: //StaticJsonDocument<192> doc; DynamicJsonDocument doc(1024); //For ESP32/ESP8266 you'll mainly use dynamic. DeserializationError error = deserializeJson(doc, client); if (!error) { float coord_lon = doc["coord"]["lon"]; float coord_lat = doc["coord"]["lat"]; JsonObject main = doc["main"]; float main_temp = main["temp"]; Serial.print("Temp: "); Serial.println(main_temp); Serial.print("Longitude: "); Serial.println(coord_lon); Serial.print("Latitude: "); Serial.println(coord_lat); } else { Serial.print(F("deserializeJson() failed: ")); Serial.println(error.f_str()); return; } } void loop() { makeHTTPRequest(); delay(1500); }
-
Converting an array of byte characters from an API into bytes using ArduinoJSON?
I've logged a github issue, but I'm not convinced I've asked the right questions as I've never had to do anything like this before - am I missing something obvious?
-
Sending arrays through serial line between 2 arduinos
https://arduinojson.org
-
[looking for help] Config File in SD Card
Also, if you want a nice way to encapsulate data, look at ArduinoJson (https://arduinojson.org/). All your information can be stored as easily identifiable strings in a JSON format. I use it all the time and it removes a lot of the mucking about with figuring out how to parse your data to/from file.
- ESP32 HTML e-Paper
-
Gamepad app with analog Joystick mode for your ESP32 projects to control your Robots using Websockets.
The format is simple JSON data and self explanatory, no binary coding, just simple text, which you can decode using https://arduinojson.org/.
- #Beguiner how can i fill my json structure from an online or off life tool
- Easiest method to get somewhat large array of information off an ESP8266
What are some alternatives?
PlasticScanner-website - Website for Plastic Scanner
cJSON - Ultralightweight JSON parser in ANSI C
RF_Links - These wireless transmitters and receivers easily fit into a breadboard and work well with microcontrollers to create a very simple wireless data link.
esp-idf-json - Example of JSON Serialize and Deserialize in ESP-IDF
arduinoWebSockets - arduinoWebSockets
yaml-cpp - A YAML parser and emitter in C++
IRremoteESP8266 - Infrared remote library for ESP8266/ESP32: send and receive infrared signals with multiple protocols. Based on: https://github.com/shirriff/Arduino-IRremote/
json - JSON for Modern C++
PlasticScanner-Software - code to run plastic scanner
RapidJSON - A fast JSON parser/generator for C++ with both SAX/DOM style API
LiveViewLegacy - Real-time tools for Imaging Spectroscopy Data
FlatBuffers - FlatBuffers: Memory Efficient Serialization Library