Skip to content
This repository has been archived by the owner on Aug 6, 2024. It is now read-only.

Commit

Permalink
feat: add segment + matrix displays (#173)
Browse files Browse the repository at this point in the history
  • Loading branch information
sverben authored Mar 16, 2024
1 parent e4ca3cf commit 595292e
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 6 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@
"@angular/platform-browser": "~16.2.12",
"@angular/platform-browser-dynamic": "~16.2.12",
"@angular/router": "16.2.12",
"@blockly/field-bitmap": "^4.0.13",
"@blockly/workspace-backpack": "^5.3.3",
"@fortawesome/fontawesome-free": "^6.1.1",
"@leaphy-robotics/leaphy-blocks": "1.17.0",
"@leaphy-robotics/leaphy-blocks": "1.18.0",
"@ngx-translate/core": "^14.0.0",
"@ngx-translate/http-loader": "^7.0.0",
"@serialport/parser-readline": "^10.3.0",
Expand Down
1 change: 1 addition & 0 deletions src/app/effects/blockly-editor.effects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {AppState} from '../state/app.state';
import {CodeEditorType} from '../domain/code-editor.type';
import {BackendWiredEffects} from "./backend.wired.effects";
import * as Blockly from 'blockly/core';
import '@blockly/field-bitmap'
import Arduino from '@leaphy-robotics/leaphy-blocks/generators/arduino';
import getBlocks from "@leaphy-robotics/leaphy-blocks/blocks/blocks";
import {
Expand Down
2 changes: 1 addition & 1 deletion src/app/state/app.state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class AppState {
/* eslint-disable max-len */
private static defaultLibraries = [
'Leaphy Original Extension', 'Leaphy Extra Extension', 'Servo', 'Adafruit GFX Library', 'Adafruit SSD1306', 'Adafruit LSM9DS1 Library',
'Adafruit Unified Sensor', 'List', 'Adafruit SGP30 Sensor', 'Adafruit_VL53L0X', 'Adafruit BMP280 Library'
'Adafruit Unified Sensor', 'List', 'Adafruit SGP30 Sensor', 'Adafruit_VL53L0X', 'Adafruit BMP280 Library', 'TM1637', 'LedControl'
]
private static leaphyOriginalRobotType = new RobotType('l_original_uno', Stk500v1, 'Leaphy Original', 'orig.svg', 'Arduino UNO', 'arduino:avr:uno', 'hex', 'arduino:avr',
AppState.defaultLibraries.concat(['QMC5883LCompass', 'Arduino_APDS9960']), true, {
Expand Down
57 changes: 57 additions & 0 deletions src/assets/blockly/leaphy-toolbox.xml
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,63 @@
</block>
</group>

<group>
<block type="leaphy_matrix_init"/>
<block type="leaphy_matrix_fill"/>
<block type="leaphy_matrix_set">
<value name="X">
<shadow type="math_number">
<field name="NUM">
0
</field>
</shadow>
</value>
<value name="Y">
<shadow type="math_number">
<field name="NUM">
0
</field>
</shadow>
</value>
<value name="ON">
<shadow type="logic_boolean" />
</value>
</block>
<block type="leaphy_matrix_set_brightness">
<value name="BRIGHTNESS">
<shadow type="math_number">
<field name="NUM">
100
</field>
</shadow>
</value>
</block>
<block type="leaphy_matrix_clear"/>
</group>

<group>
<block type="leaphy_segment_init"/>
<block type="leaphy_segment_set">
<value name="NUM">
<shadow type="math_number">
<field name="NUM">
0
</field>
</shadow>
</value>
</block>
<block type="leaphy_segment_clear"/>
<block type="leaphy_segment_set_brightness">
<value name="BRIGHTNESS">
<shadow type="math_number">
<field name="NUM">
0
</field>
</shadow>
</value>
</block>
</group>

<group>
<block type="i2c_list_devices">
<robots>
Expand Down
13 changes: 9 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1444,6 +1444,11 @@
"@babel/helper-validator-identifier" "^7.22.20"
to-fast-properties "^2.0.0"

"@blockly/field-bitmap@^4.0.13":
version "4.0.13"
resolved "https://registry.yarnpkg.com/@blockly/field-bitmap/-/field-bitmap-4.0.13.tgz#3f716eea52582bb69f40273236a1ff198755ef58"
integrity sha512-DrbqRUy0TgTwjo0pcuXBLOafZ3qFipn1SSKPKjMP5F9JSJMAprnbhYC3OI1maY5Rs9x3ndGFdKpmw19XkqJHcA==

"@blockly/workspace-backpack@^5.3.3":
version "5.3.3"
resolved "https://registry.yarnpkg.com/@blockly/workspace-backpack/-/workspace-backpack-5.3.3.tgz#e5af9abe41080aa0d0754b1a1220e938a273dbe7"
Expand Down Expand Up @@ -1828,10 +1833,10 @@
resolved "https://registry.yarnpkg.com/@juggle/resize-observer/-/resize-observer-3.4.0.tgz#08d6c5e20cf7e4cc02fd181c4b0c225cd31dbb60"
integrity sha512-dfLbk+PwWvFzSxwk3n5ySL0hfBog779o8h68wK/7/APo/7cgyWp5jcXockbxdk5kFRkbeXWm4Fbi9FrdN381sA==

"@leaphy-robotics/leaphy-blocks@1.17.0":
version "1.17.0"
resolved "https://registry.yarnpkg.com/@leaphy-robotics/leaphy-blocks/-/leaphy-blocks-1.17.0.tgz#a6b5e129bd611aef8c23e2bcfe5e19467d27859f"
integrity sha512-HHulLpjP5U0M56fX9NkFE8nfLh2jJf7vphF1IU1WDgQjjTfptkNDKLXgovyUnIaW3DALS0RDnKioLMhvtlat+A==
"@leaphy-robotics/leaphy-blocks@1.18.0":
version "1.18.0"
resolved "https://registry.yarnpkg.com/@leaphy-robotics/leaphy-blocks/-/leaphy-blocks-1.18.0.tgz#b7da698d1da480ceef30f9827f9aeea25b23ecd0"
integrity sha512-V+4aYP1PjofRtrqBRIc9kvQENbxNN2F3jB9A+nv3FMJ4YQ+FWs/youHL/V+SUl9Qb/uZZ8Vlwo90Ssltv1Kshw==
dependencies:
blockly "^10.1.3"
typescript "4.3.2"
Expand Down

0 comments on commit 595292e

Please sign in to comment.