Skip to content

Commit b88c23f

Browse files
committed
feat(neopixel): add pinInfo
1 parent c8a55aa commit b88c23f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/neopixel-element.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
import { customElement, html, LitElement, property } from 'lit-element';
2+
import { ElementPin, GND, VCC } from './pin';
23

34
@customElement('wokwi-neopixel')
45
export class NeoPixelElement extends LitElement {
56
@property() r = 0;
67
@property() g = 0;
78
@property() b = 0;
89

10+
readonly pinInfo: ElementPin[] = [
11+
{ name: 'VDD', y: 3.5, x: 0, number: 1, signals: [VCC()] },
12+
{ name: 'DOUT', y: 15.5, x: 0, number: 2, signals: [] },
13+
{ name: 'VSS', y: 15.5, x: 22, number: 3, signals: [{ type: 'power', signal: 'GND' }] },
14+
{ name: 'DIN', y: 3.5, x: 22, number: 4, signals: [GND()] },
15+
];
16+
917
render() {
1018
const { r, g, b } = this;
1119
const spotOpacity = (value: number) => (value > 0.001 ? 0.7 + value * 0.3 : 0);

0 commit comments

Comments
 (0)