Skip to content

Instantly share code, notes, and snippets.

2nd experience with ChatGPT from OpenAI:
/// 2nd Input: create google sheets script for a year of data by the month of bme280 sensor data
function createSheets() {
var ss = SpreadsheetApp.getActive();
var data = ss.getDataRange().getValues();
// Create a map to store the sheets by month
// BME280 ChatGPT6 Google App Script project
// This Google App Script collects data from a web service and appends it to a Google Sheet.
// It uses the doGet() function to parse the data and append it to the sheet.
// The getSheetForMonth() function is used to get the current sheet for the month or create
// a new one if it doesn't exist.
// The getMonthName() function is used to get the name of the month for the given month number.
// The addNewSheetAtEndOfMonth() function is used to create a new sheet at the end of each month,
// allowing the script to collect data for a full year.
/*
testForNextYear Google App script
01/31/2023
OpenAI.com, ChatGPT code modified by William Lucid
Add to Gist BME280 ChatGPT6 GS Script project file.
*/
@Tech500
Tech500 / BME280 Logging
Last active August 1, 2023 05:01
Google Sheet script for month to month data logging plus function to send data from ESP32 sketch to Google Sheet.
// This is a Google Script that retrieves environmental data (datetime, temperature, heat index, humidity, dewpoint, pressure, and a difference value) from a web
// interface and appends it to a Google Spreadsheet. The sheet name is based on the current month and year, and a new sheet will be created with an additional number
// if the sheet with the same name already exists. If it's the last day of the current month, a new sheet for the next month will be created. The script has several
// functions, including getting the name of the current month, creating a new sheet with the specified name, adding headers to the new sheet, and appending the data
// to the sheet.
// Google Sheets App script created in parts by Google's Bard. Additional code by William Lucid 07/02/2023
// ESP32 Project repository: https://github.com/Tech500/CameraRainGauge
"""
wled_effects_sleep_fp_add_urls.py Developed by William Lucid 02/12/2023 with assist from OpenAI's ChatGPT.
WLED HTTP API reference: https://kno.wled.ge/interfaces/http-api/
"""
import requests
import time
/*
ESP32 MPU6050 Accelerometer Gyroscope Sensor utility
Developed by William Lucid with assist from OpenAI's ChatGPT 02/22/2023
Collects 40 "passes" of collecting MPU6050 data; then FTP server becomes available for reading data from LittleFS
log file. FTP works well with Fillza.
*/
// Based on Adafruit MPU6050 library example, "Basic_demo.ino" for accelerometer readings.
/*
Developed by William Lucid with assist from OpenAI's, ChatGPT
04/26/2023
*/
#include "esp_sleep.h"
int switchPin = 27; // Use GPIO27 for the switch pin
int switchState = HIGH; // Current state of the switch
int lastSwitchState = HIGH; // Last state of the switch
@Tech500
Tech500 / BME280 Data Logging
Last active November 4, 2024 04:56
Google Sheets, Script for logging data in yearly workbook; with monthly log sheets. Updated 12/31/2023
const sheet_id = "Google Sheet id";
function doGet(e) {
const dtstamp = e.parameter.dtstamp;
const temp = e.parameter.temp;
const heatindex = e.parameter.heatindex;
const humidity = e.parameter.humidity;
const dewpoint = e.parameter.dewpoint;
const pressure = e.parameter.pressure;
const diff = e.parameter.diff;
/*
Web page from Asynwebserver CameraRainGauge project
Web site: http://weather.ddns.net
*/
//index6.h
const char HTML7[] PROGMEM = R"====(
/*
Wyse Cam v3 WebRTC url webpage using Wyze-Bridge as video source.
*/
//index6.h
const char HTML7[] PROGMEM = R"====(
<!DOCTYPE html>
<html>