From decisions to electronic logic
Computers do not think. They follow instructions step by step to change information.
computation = applying rules reliably at scale
| /* | |
| ESP32-WROOM + HC-SR04 (x6) + Relays (x6) + Web UI + Persistent config + Debug logger | |
| Additions in this version: | |
| - Sensor->Relay mapping is configurable (one-to-one, one-to-many, many-to-one) | |
| - Mapping editor in Web UI (checkbox matrix), persisted in NVS (Preferences) | |
| - AUTO mode uses mapping: relayTarget[r] = OR( sensorState[s] for all mapped sensors->r ) | |
| - /status includes sensors + relays + heartbeat (millis), UI refresh is 0.5s | |
| IMPORTANT ELECTRICAL NOTE: |
| โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ | |
| โ LLUM BARCELONA ยท SYSTEM MAP โ | |
| โ (robot ยท vision ยท sensing ยท light) โ | |
| โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ | |
| โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ | |
| โ HANDHELD REMOTE โ | |
| โ ESP32 โ |
Hello,
The following is an informal collection of readings, tools, and platforms curated during the last two months by the Fab Lab Barcelona team. ๐
We plan to send a thought-provoking collection every 2-3 months. ๐ The summary and clustering of the articles are automatically done by GPT using the Bing extension; errors are expected.
We hope you like it, and remember to check out our blog. ๐
| #include <Wire.h> | |
| /* | |
| * Set I2C Slave address | |
| */ | |
| #define I2C_SLAVE_ADDRESS 0x7 | |
| #define SENSOR A0 | |
| ID | Name | Unit | RAW? |
|---|---|---|---|
| 10 | Battery SCK 1.1 | (%) | N |
| 14 | BH1730FVC | (Lux) | N |
| 15 | (kOhm) | Y | |
| 16 | (kOhm) | Y | |
| 53 | ICS43432 - Noise | (dBA) | N |
| 55 | SHT31 - Temperature | (ยบC) | N |
| 56 | SHT31 - Humidity | (%) | N |
| 58 | MPL3115A2 - Barometric Pressure | (kPa) | N |
| int const PIRpin = 2; | |
| unsigned long previousMillis = 0; | |
| const long interval = 2000; | |
| int prevPinStatus = 0; | |
| long presenceCounter = 0; | |
| void setup() { | |
| Serial.begin(9600); | |
| pinMode(PIRpin, INPUT); |
| /* | |
| ESP8266 example for tone via timer1 | |
| Hardware: NodeMCU | |
| 2018 | |
| tone using Timer | |
| */ | |
| //define ITONE_CYCLE 2500000 // 1 second cycle in 1/16 CPU clock (1/5 ยตs) for 80 MHz | |
| #define ITONE_CYCLE 5000000 // 1 second cycle in 1/16 CPU clock (1/5 ยตs) for 160 MHz | |