fix(examples): correct SSD1306 + big-sound-sensor pin names
robot-desktop-eyes and the day-30/100-days OLED example wired the SSD1306 OLED with SDA/SCL/VCC, but the wokwi-ssd1306 element exposes pinInfo as DATA/CLK/VIN/GND. The mismatched names couldn't resolve, so all three wire endpoints fell back to (0,0) of the component and visually attached to the corner instead of the pins. Same class of bug on the wokwi-big-sound-sensor in robot-desktop-eyes: the element has AOUT/DOUT (no plain OUT). The sketch uses digitalRead(SOUND_PIN), so route to DOUT. The COMPONENT_PIN_ALIASES map in wokwiZip.ts only normalises on .zip import — static examples have to use the real pinInfo names.
This commit is contained in:
parent
5bd541e56f
commit
2dea3f0448
|
|
@ -2288,10 +2288,10 @@ class SSD1306_SPI(SSD1306):
|
||||||
],
|
],
|
||||||
wires: [
|
wires: [
|
||||||
// OLED I2C — SDA = GPIO21, SCL = GPIO22 (matches SoftI2C in code)
|
// OLED I2C — SDA = GPIO21, SCL = GPIO22 (matches SoftI2C in code)
|
||||||
{ id: 'w-oled-vcc', start: { componentId: 'esp32', pinName: '3V3' }, end: { componentId: 'oled1', pinName: 'VCC' }, color: '#ff4444' },
|
{ id: 'w-oled-vcc', start: { componentId: 'esp32', pinName: '3V3' }, end: { componentId: 'oled1', pinName: 'VIN' }, color: '#ff4444' },
|
||||||
{ id: 'w-oled-gnd', start: { componentId: 'esp32', pinName: 'GND.1' }, end: { componentId: 'oled1', pinName: 'GND' }, color: '#000000' },
|
{ id: 'w-oled-gnd', start: { componentId: 'esp32', pinName: 'GND.1' }, end: { componentId: 'oled1', pinName: 'GND' }, color: '#000000' },
|
||||||
{ id: 'w-oled-sda', start: { componentId: 'esp32', pinName: '21' }, end: { componentId: 'oled1', pinName: 'SDA' }, color: '#22aaff' },
|
{ id: 'w-oled-sda', start: { componentId: 'esp32', pinName: '21' }, end: { componentId: 'oled1', pinName: 'DATA' }, color: '#22aaff' },
|
||||||
{ id: 'w-oled-scl', start: { componentId: 'esp32', pinName: '22' }, end: { componentId: 'oled1', pinName: 'SCL' }, color: '#ff8800' },
|
{ id: 'w-oled-scl', start: { componentId: 'esp32', pinName: '22' }, end: { componentId: 'oled1', pinName: 'CLK' }, color: '#ff8800' },
|
||||||
// Buttons — HIGH-when-pressed (one side to 3V3, other to GPIO). Code
|
// Buttons — HIGH-when-pressed (one side to 3V3, other to GPIO). Code
|
||||||
// reads pin.value() == 1 on press, so they sit between 3.3V and the
|
// reads pin.value() == 1 on press, so they sit between 3.3V and the
|
||||||
// input pin. Add Pin.PULL_DOWN in MicroPython if the pin floats.
|
// input pin. Add Pin.PULL_DOWN in MicroPython if the pin floats.
|
||||||
|
|
|
||||||
|
|
@ -122,7 +122,7 @@ export const robotDesktopExamples: ExampleProject[] = [
|
||||||
// off the ESP32. The two servos run off 3V3 too because the
|
// off the ESP32. The two servos run off 3V3 too because the
|
||||||
// simulator doesn't model the brown-out a real SG90 would
|
// simulator doesn't model the brown-out a real SG90 would
|
||||||
// cause — on real hardware they'd need an external 5V.
|
// cause — on real hardware they'd need an external 5V.
|
||||||
w('p-oled-vcc', ['esp32', '3V3'], ['oled', 'VCC'], '#ff0000'),
|
w('p-oled-vcc', ['esp32', '3V3'], ['oled', 'VIN'], '#ff0000'),
|
||||||
w('p-oled-gnd', ['oled', 'GND'], ['esp32', 'GND'], '#000000'),
|
w('p-oled-gnd', ['oled', 'GND'], ['esp32', 'GND'], '#000000'),
|
||||||
w('p-dht-vcc', ['esp32', '3V3'], ['dht', 'VCC'], '#ff0000'),
|
w('p-dht-vcc', ['esp32', '3V3'], ['dht', 'VCC'], '#ff0000'),
|
||||||
w('p-dht-gnd', ['dht', 'GND'], ['esp32', 'GND'], '#000000'),
|
w('p-dht-gnd', ['dht', 'GND'], ['esp32', 'GND'], '#000000'),
|
||||||
|
|
@ -140,13 +140,13 @@ export const robotDesktopExamples: ExampleProject[] = [
|
||||||
// ── I²C bus: OLED on the ESP32's default I²C (SDA=21, SCL=22).
|
// ── I²C bus: OLED on the ESP32's default I²C (SDA=21, SCL=22).
|
||||||
// U8G2_SSD1306_128X64_NONAME_F_HW_I2C in the sketch uses
|
// U8G2_SSD1306_128X64_NONAME_F_HW_I2C in the sketch uses
|
||||||
// Wire.begin() which defaults to these pins.
|
// Wire.begin() which defaults to these pins.
|
||||||
w('i2c-sda', ['esp32', '21'], ['oled', 'SDA'], '#ffd000'),
|
w('i2c-sda', ['esp32', '21'], ['oled', 'DATA'], '#ffd000'),
|
||||||
w('i2c-scl', ['esp32', '22'], ['oled', 'SCL'], '#00d0ff'),
|
w('i2c-scl', ['esp32', '22'], ['oled', 'CLK'], '#00d0ff'),
|
||||||
|
|
||||||
// ── Sensor signal lines, matching Common.h's #define block.
|
// ── Sensor signal lines, matching Common.h's #define block.
|
||||||
w('s-dht', ['dht', 'SDA'], ['esp32', '15'], '#00ffaa'),
|
w('s-dht', ['dht', 'SDA'], ['esp32', '15'], '#00ffaa'),
|
||||||
w('s-pir', ['pir', 'OUT'], ['esp32', '4'], '#ff00ff'),
|
w('s-pir', ['pir', 'OUT'], ['esp32', '4'], '#ff00ff'),
|
||||||
w('s-snd', ['sound', 'OUT'], ['esp32', '2'], '#ffaa00'),
|
w('s-snd', ['sound', 'DOUT'], ['esp32', '2'], '#ffaa00'),
|
||||||
w('s-ldr', ['ldr', 'AO'], ['esp32', '34'], '#aaff00'),
|
w('s-ldr', ['ldr', 'AO'], ['esp32', '34'], '#aaff00'),
|
||||||
|
|
||||||
// ── Servo signal lines (PWM via LEDC on the ESP32).
|
// ── Servo signal lines (PWM via LEDC on the ESP32).
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue