Skip to content

Commit 424925b

Browse files
committed
feat(potentiometer): add pinInfo
also swap VCC/SIG pin locations, as it is more common for the variable pin to be in the middle
1 parent 8a5f125 commit 424925b

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/potentiometer-element.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { css, customElement, html, LitElement, property } from 'lit-element';
22
import { styleMap } from 'lit-html/directives/style-map';
3+
import { analog, ElementPin } from './pin';
34

45
interface Point {
56
x: number;
@@ -19,6 +20,12 @@ export class PotentiometerElement extends LitElement {
1920
private center: Point = { x: 0, y: 0 };
2021
private pressed = false;
2122

23+
readonly pinInfo: ElementPin[] = [
24+
{ name: 'GND', x: 29, y: 68.5, number: 1, signals: [{ type: 'power', signal: 'GND' }] },
25+
{ name: 'SIG', x: 37, y: 68.5, number: 2, signals: [analog(0)] },
26+
{ name: 'VCC', x: 44.75, y: 68.5, number: 3, signals: [{ type: 'power', signal: 'VCC' }] },
27+
];
28+
2229
static get styles() {
2330
return css`
2431
#rotating {
@@ -130,8 +137,8 @@ export class PotentiometerElement extends LitElement {
130137
/>
131138
<g stroke-width=".15">
132139
<text x="6.21" y="16.6">GND</text>
133-
<text x="8.75" y="16.63">VCC</text>
134-
<text x="11.25" y="16.59">SIG</text>
140+
<text x="8.75" y="16.63">SIG</text>
141+
<text x="11.25" y="16.59">VCC</text>
135142
</g>
136143
<g fill="#fff" stroke-width=".15">
137144
<ellipse cx="1.68" cy="1.81" rx=".99" ry=".96" />

0 commit comments

Comments
 (0)