diff --git a/frontend/src/components/simulator/SimulatorCanvas.tsx b/frontend/src/components/simulator/SimulatorCanvas.tsx
index 0653eb5b..d1ae203d 100644
--- a/frontend/src/components/simulator/SimulatorCanvas.tsx
+++ b/frontend/src/components/simulator/SimulatorCanvas.tsx
@@ -1100,8 +1100,11 @@ export const SimulatorCanvas = ({ headerSlot }: SimulatorCanvasProps = {}) => {
case 'nano-rp2040':
ledPin = 25; // GPIO25
break;
+ case 'attiny85':
+ ledPin = 1; // PB1 (Digispark convention)
+ break;
default:
- ledPin = 13; // Pin 13 for Arduino Uno/Nano/Mega, ATtiny85, etc.
+ ledPin = 13; // Pin 13 for Arduino Uno/Nano/Mega
}
unsubs.push(
diff --git a/frontend/src/components/velxio-components/Attiny85Element.ts b/frontend/src/components/velxio-components/Attiny85Element.ts
index 40d1121b..32b167bc 100644
--- a/frontend/src/components/velxio-components/Attiny85Element.ts
+++ b/frontend/src/components/velxio-components/Attiny85Element.ts
@@ -14,7 +14,7 @@
* pinInfo) but external components positioned to the right of the
* chip may need to be moved manually for clean routing.
*
- * viewBox 28.801 × 23.768 mm scaled uniformly at 5.555 px/mm → 160 × 132 px.
+ * viewBox 28.801 x 23.768 mm scaled uniformly at 5.555 px/mm -> 160 x 132 px.
* Pin terminal centres in the source SVG (mm), all 8 connectors:
* row x y pin label
* top 3.601 1.084 VCC (connector7)
@@ -26,8 +26,8 @@
* bottom 18.000 22.687 PB4 (connector2)
* bottom 25.201 22.687 GND (connector3)
*
- * Built-in LED on PB1 (Digispark convention) is overlaid as a circle in
- * the outer SVG — drives off the `led1` attribute / property like before.
+ * No fake on-board LED is drawn. The bare DIP-8 has no PCB LED — examples
+ * wire a real wokwi-led + wokwi-resistor to PB1 like the c3-blink one does.
*/
const W = 160;
@@ -40,7 +40,7 @@ const PIN_INFO: ReadonlyArray<{ name: string; x: number; y: number; description?
// Top row — left to right
{ name: 'VCC', x: PIN_X[0], y: TOP_Y, description: 'VCC (Pin 8)' },
{ name: 'PB2', x: PIN_X[1], y: TOP_Y, description: 'PB2 / SCK / SCL / ADC1 (Pin 7)' },
- { name: 'PB1', x: PIN_X[2], y: TOP_Y, description: 'PB1 / MISO / built-in LED (Pin 6)' },
+ { name: 'PB1', x: PIN_X[2], y: TOP_Y, description: 'PB1 / MISO / OC0B / OC1A (Pin 6)' },
{ name: 'PB0', x: PIN_X[3], y: TOP_Y, description: 'PB0 / MOSI / SDA / OC0A (Pin 5)' },
// Bottom row — left to right
{ name: 'PB5', x: PIN_X[0], y: BOT_Y, description: 'PB5 / RESET (Pin 1)' },
@@ -50,12 +50,6 @@ const PIN_INFO: ReadonlyArray<{ name: string; x: number; y: number; description?
];
class Attiny85Element extends HTMLElement {
- static get observedAttributes(): string[] {
- return ['led1'];
- }
-
- private _led1 = false;
-
constructor() {
super();
this.attachShadow({ mode: 'open' });
@@ -65,52 +59,14 @@ class Attiny85Element extends HTMLElement {
this.render();
}
- attributeChangedCallback(name: string, _old: string | null, value: string | null) {
- if (name === 'led1') {
- this._led1 = value !== null && value !== 'false';
- this.updateLed();
- }
- }
-
/** Wires use this to find pin coordinates. */
get pinInfo() {
return PIN_INFO;
}
- set led1(v: boolean) {
- this._led1 = !!v;
- this.updateLed();
- }
- get led1(): boolean {
- return this._led1;
- }
-
- private updateLed() {
- const led = this.shadowRoot?.getElementById('attiny-led1') as unknown as SVGElement | null;
- if (!led) return;
- if (this._led1) {
- led.setAttribute('fill', '#ffee44');
- led.setAttribute('stroke', '#ffcc00');
- led.style.filter = 'drop-shadow(0 0 4px #ffcc00)';
- } else {
- led.setAttribute('fill', '#333');
- led.setAttribute('stroke', '#555');
- led.style.filter = 'none';
- }
- }
-
private render() {
if (!this.shadowRoot) return;
- const ledFill = this._led1 ? '#ffee44' : '#333';
- const ledStroke = this._led1 ? '#ffcc00' : '#555';
- const ledFilter = this._led1 ? 'drop-shadow(0 0 4px #ffcc00)' : 'none';
-
- // Place the LED indicator just ABOVE the PB1 top-pin (PIN_X[2], TOP_Y),
- // outside the chip body so it stays readable.
- const ledX = PIN_X[2];
- const ledY = TOP_Y - 12;
-
this.shadowRoot.innerHTML = `