Skip to content

Commit 24974a4

Browse files
committed
feat(hc-sr04): align pins position to grid, also fix texts to uppercase
1 parent 42d8107 commit 24974a4

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

src/hc-sr04-element.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ import { ElementPin } from './pin';
55
@customElement('wokwi-hc-sr04')
66
export class HCSR04Element extends LitElement {
77
readonly pinInfo: ElementPin[] = [
8-
{ name: 'VCC', x: 71.78, y: 94.5, signals: [{ type: 'power', signal: 'VCC', voltage: 5 }] },
9-
{ name: 'TRIG', x: 79.67, y: 94.5, signals: [] },
10-
{ name: 'ECHO', x: 87.56, y: 94.5, signals: [] },
11-
{ name: 'GND', x: 95.45, y: 94.5, signals: [{ type: 'power', signal: 'GND' }] },
8+
{ name: 'VCC', x: 71.3, y: 94.5, signals: [{ type: 'power', signal: 'VCC', voltage: 5 }] },
9+
{ name: 'TRIG', x: 81.3, y: 94.5, signals: [] },
10+
{ name: 'ECHO', x: 91.3, y: 94.5, signals: [] },
11+
{ name: 'GND', x: 101.3, y: 94.5, signals: [{ type: 'power', signal: 'GND' }] },
1212
];
1313

1414
render() {
@@ -68,18 +68,18 @@ export class HCSR04Element extends LitElement {
6868
/>
6969
<g fill="black">
7070
<rect x="17.87" y="18" ry=".568" width="2.25" height="2.271" />
71-
<rect x="19.95" y="18" ry=".568" width="2.25" height="2.271" />
72-
<rect x="22.04" y="18" ry=".568" width="2.25" height="2.271" />
73-
<rect x="24.12" y="18" ry=".568" width="2.25" height="2.271" />
71+
<rect x="20.41" y="18" ry=".568" width="2.25" height="2.271" />
72+
<rect x="22.95" y="18" ry=".568" width="2.25" height="2.271" />
73+
<rect x="25.49" y="18" ry=".568" width="2.25" height="2.271" />
7474
</g>
7575
<g fill="#ccc" stroke-linecap="round" stroke-width=".21">
76-
<rect x="18.616" y="19" width=".75" height="7" rx=".2" />
77-
<rect x="20.702" y="19" width=".75" height="7" rx=".2" />
78-
<rect x="22.789" y="19" width=".75" height="7" rx=".2" />
79-
<rect x="24.875" y="19" width=".75" height="7" rx=".2" />
76+
<rect x="18.61" y="19" width=".75" height="7" rx=".2" />
77+
<rect x="21.15" y="19" width=".75" height="7" rx=".2" />
78+
<rect x="23.69" y="19" width=".75" height="7" rx=".2" />
79+
<rect x="26.23" y="19" width=".75" height="7" rx=".2" />
8080
</g>
8181
<text font-weight="400" font-size="2.2" fill="#e6e6e6" stroke-width=".055">
82-
<tspan y="8" x="18">HC-SR04</tspan>
82+
<tspan y="8" x="17.6">HC-SR04</tspan>
8383
</text>
8484
<text
8585
transform="rotate(-90)"
@@ -88,10 +88,10 @@ export class HCSR04Element extends LitElement {
8888
fill="#e6e6e6"
8989
stroke-width=".039"
9090
>
91-
<tspan x="-17.591" y="19.561">Vcc</tspan>
92-
<tspan x="-17.591" y="21.654">Trig</tspan>
93-
<tspan x="-17.591" y="23.747">Echo</tspan>
94-
<tspan x="-17.591" y="25.84">Gnd</tspan>
91+
<tspan x="-17.591" y="19.561">VCC</tspan>
92+
<tspan x="-17.591" y="22.101">TRIG</tspan>
93+
<tspan x="-17.591" y="24.641">ECHO</tspan>
94+
<tspan x="-17.591" y="27.181">GND</tspan>
9595
</text>
9696
</svg>
9797
`;

0 commit comments

Comments
 (0)