Skip to content
This repository was archived by the owner on Dec 23, 2021. It is now read-only.

Commit 64a97be

Browse files
authored
Working Backend and Frontend for CLUE Screen (#266)
Initial backend and frontend for CLUE screen work
1 parent 813b285 commit 64a97be

67 files changed

Lines changed: 28454 additions & 68 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
123 KB
Binary file not shown.

gulpfile.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ gulp.task("clean", () => {
3535

3636
const pythonToMove = [
3737
"./src/adafruit_circuitplayground/*.*",
38+
"./src/clue/*.*",
39+
"./src/clue/!(test)/**/*",
40+
"./src/base_circuitpython/**/*",
3841
"./src/micropython/*.*",
3942
"./src/micropython/microbit/*.*",
4043
"./src/micropython/microbit/!(test)/**/*",

locales/en/package.i18n.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"deviceSimulatorExpressExtension.commands.common.label": "Device Simulator Express",
44
"deviceSimulatorExpressExtension.commands.common.runSimulator": "Run Simulator",
55
"deviceSimulatorExpressExtension.commands.common.gettingStarted": "Getting Started",
6-
76
"deviceSimulatorExpressExtension.commands.common.changeBaudRate": "Change Baud Rate",
87
"deviceSimulatorExpressExtension.commands.common.closeSerialMonitor": "Close Serial Monitor",
98
"deviceSimulatorExpressExtension.commands.common.openSerialMonitor": "Open Serial Monitor",
@@ -14,8 +13,10 @@
1413
"deviceSimulatorExpressExtension.commands.microbit.deployToDevice": "[micro:bit] Deploy to Device",
1514
"deviceSimulatorExpressExtension.commands.microbit.openSimulator": "[micro:bit] Open Simulator",
1615
"deviceSimulatorExpressExtension.commands.microbit.newFile": "[micro:bit] New File",
16+
"deviceSimulatorExpressExtension.commands.clue.openSimulator": "[Clue] Open Simulator",
17+
"deviceSimulatorExpressExtension.commands.clue.newFile": "[Clue] New File",
1718
"deviceSimulatorExpressExtension.configuration.title": "Device Simulator Express configuration",
1819
"deviceSimulatorExpressExtension.configuration.properties.configEnvOnChange": "When you change the Python interpreter, the Device Simulator Express will automatically configure itself for the required dependencies.",
1920
"deviceSimulatorExpressExtension.configuration.properties.debuggerPort": "The port the Server will listen on for communication with the debugger.",
2021
"deviceSimulatorExpressExtension.configuration.properties.dependencyChecker": "Whether or not to ask if we can download dependencies. If unchecked, the extension will default to never download dependencies, except when automatically creating a virtual environment in the extension files."
21-
}
22+
}

package.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141
"onCommand:deviceSimulatorExpress.microbit.deployToDevice",
4242
"onCommand:deviceSimulatorExpress.microbit.newFile",
4343
"onCommand:deviceSimulatorExpress.microbit.openSimulator",
44+
"onCommand:deviceSimulatorExpress.clue.newFile",
45+
"onCommand:deviceSimulatorExpress.clue.openSimulator",
4446
"onDebug"
4547
],
4648
"main": "./out/extension.js",
@@ -110,6 +112,16 @@
110112
"command": "deviceSimulatorExpress.microbit.newFile",
111113
"title": "%deviceSimulatorExpressExtension.commands.microbit.newFile%",
112114
"category": "%deviceSimulatorExpressExtension.commands.common.label%"
115+
},
116+
{
117+
"command": "deviceSimulatorExpress.clue.openSimulator",
118+
"title": "%deviceSimulatorExpressExtension.commands.clue.openSimulator%",
119+
"category": "%deviceSimulatorExpressExtension.commands.common.label%"
120+
},
121+
{
122+
"command": "deviceSimulatorExpress.clue.newFile",
123+
"title": "%deviceSimulatorExpressExtension.commands.clue.newFile%",
124+
"category": "%deviceSimulatorExpressExtension.commands.common.label%"
113125
}
114126
],
115127
"colors": [
@@ -342,4 +354,4 @@
342354
"extensionDependencies": [
343355
"ms-python.python"
344356
]
345-
}
357+
}

package.nls.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"deviceSimulatorExpressExtension.commands.common.label": "Device Simulator Express",
44
"deviceSimulatorExpressExtension.commands.common.runSimulator": "Run Simulator",
55
"deviceSimulatorExpressExtension.commands.common.gettingStarted": "Getting Started",
6-
76
"deviceSimulatorExpressExtension.commands.common.changeBaudRate": "Change Baud Rate",
87
"deviceSimulatorExpressExtension.commands.common.closeSerialMonitor": "Close Serial Monitor",
98
"deviceSimulatorExpressExtension.commands.common.openSerialMonitor": "Open Serial Monitor",
@@ -14,8 +13,10 @@
1413
"deviceSimulatorExpressExtension.commands.microbit.deployToDevice": "[micro:bit] Deploy to Device",
1514
"deviceSimulatorExpressExtension.commands.microbit.openSimulator": "[micro:bit] Open Simulator",
1615
"deviceSimulatorExpressExtension.commands.microbit.newFile": "[micro:bit] New File",
16+
"deviceSimulatorExpressExtension.commands.clue.openSimulator": "[Clue] Open Simulator",
17+
"deviceSimulatorExpressExtension.commands.clue.newFile": "[Clue] New File",
1718
"deviceSimulatorExpressExtension.configuration.title": "Device Simulator Express configuration",
1819
"deviceSimulatorExpressExtension.configuration.properties.configEnvOnChange": "When you change the Python interpreter, the Device Simulator Express will automatically configure itself for the required dependencies.",
1920
"deviceSimulatorExpressExtension.configuration.properties.debuggerPort": "The port the Server will listen on for communication with the debugger.",
2021
"deviceSimulatorExpressExtension.configuration.properties.dependencyChecker": "Whether or not to ask for dependency downloads. If unchecked, the extension will default to never download dependencies, except when automatically creating a virtual environment in the extension files."
21-
}
22+
}

src/base_circuitpython/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import pathlib
2+
import os
3+
import sys
4+
5+
abs_path = pathlib.Path(__file__).parent.absolute()
6+
sys.path.insert(0, os.path.join(abs_path))
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CPX = "CPX"
2+
CLUE = "CLUE"
3+
PIXELS = "pixels"
4+
5+
CLUE_PIN = "D18"
6+
7+
IMG_DIR_NAME = "img"
8+
SCREEN_HEIGHT_WIDTH = 240

src/base_circuitpython/board.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# dummy class for references to board display to work
2+
# https://learn.adafruit.com/arduino-to-circuitpython/the-board-module
3+
4+
5+
class Display:
6+
def __init__(self):
7+
pass
8+
9+
def show(self, group):
10+
group.draw()
11+
12+
13+
DISPLAY = Display()
14+
15+
# deafult pin,
16+
# shows that this could
17+
# refer to the CPX
18+
# or CLUE neopixel pin
19+
NEOPIXEL = "D00"
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# dummy class for neopixel library to work
2+
3+
# original implementation docs for digitalio:
4+
# https://circuitpython.readthedocs.io/en/5.0.x/shared-bindings/digitalio/__init__.html
5+
6+
7+
class DigitalInOut:
8+
def __init__(self, pin):
9+
self.pin = pin
10+
pass
11+
12+
def deinit(self):
13+
pass
14+
15+
16+
class Direction:
17+
OUTPUT = 0
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Displayio implementation loosely based on the
2+
# displayio package in Adafruit CircuitPython
3+
4+
# https://circuitpython.readthedocs.io/en/5.0.x/shared-bindings/displayio/__init__.html
5+
6+
from .bitmap import Bitmap
7+
from .color_type import ColorType
8+
from .group import Group
9+
from .palette import Palette
10+
11+
# references to img and bmp_img are for testing purposes
12+
from .tile_grid import TileGrid, img, bmp_img

0 commit comments

Comments
 (0)