diff --git a/.github/makecode/blocks.png b/.github/makecode/blocks.png deleted file mode 100644 index 30e028d..0000000 Binary files a/.github/makecode/blocks.png and /dev/null differ diff --git a/.github/makecode/blocksdiff.png b/.github/makecode/blocksdiff.png deleted file mode 100644 index 3ea8b98..0000000 Binary files a/.github/makecode/blocksdiff.png and /dev/null differ diff --git a/.github/workflows/makecode.yml b/.github/workflows/makecode.yml deleted file mode 100644 index 1aa354c..0000000 --- a/.github/workflows/makecode.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: MakeCode - -on: [push] - -jobs: - build: - - runs-on: ubuntu-latest - - strategy: - matrix: - node-version: [8.x] - - steps: - - uses: actions/checkout@v1 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} - - name: npm install - run: | - npm install -g pxt - pxt target microbit - - name: build - run: | - pxt install - pxt build --cloud - env: - CI: true diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index f8106d4..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "editor.formatOnType": true, - "files.autoSave": "afterDelay", - "files.watcherExclude": { - "**/.git/objects/**": true, - "**/built/**": true, - "**/node_modules/**": true, - "**/yotta_modules/**": true, - "**/yotta_targets": true, - "**/pxt_modules/**": true - }, - "files.associations": { - "*.blocks": "html", - "*.jres": "json" - }, - "search.exclude": { - "**/built": true, - "**/node_modules": true, - "**/yotta_modules": true, - "**/yotta_targets": true, - "**/pxt_modules": true - } -} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json deleted file mode 100644 index 9ee2cf6..0000000 --- a/.vscode/tasks.json +++ /dev/null @@ -1,30 +0,0 @@ - -// A task runner that calls the MakeCode (PXT) compiler -{ - "version": "2.0.0", - "tasks": [{ - "label": "pxt deploy", - "type": "shell", - "command": "pxt deploy --local", - "group": "build", - "problemMatcher": [ "$tsc" ] - }, { - "label": "pxt build", - "type": "shell", - "command": "pxt build --local", - "group": "build", - "problemMatcher": [ "$tsc" ] - }, { - "label": "pxt install", - "type": "shell", - "command": "pxt install", - "group": "build", - "problemMatcher": [ "$tsc" ] - }, { - "label": "pxt clean", - "type": "shell", - "command": "pxt clean", - "group": "test", - "problemMatcher": [ "$tsc" ] - }] -} diff --git a/Gemfile b/Gemfile deleted file mode 100644 index 91ceacd..0000000 --- a/Gemfile +++ /dev/null @@ -1,2 +0,0 @@ -source 'https://rubygems.org' -gem 'github-pages', group: :jekyll_plugins \ No newline at end of file diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 936b43f..0000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2021 Alexander Davis - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/Makefile b/Makefile deleted file mode 100644 index 9068464..0000000 --- a/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -all: deploy - -build: - pxt build - -deploy: - pxt deploy - -test: - pxt test diff --git a/README.md b/README.md deleted file mode 100644 index f114122..0000000 --- a/README.md +++ /dev/null @@ -1,31 +0,0 @@ - -> Open this page at [https://alexanderedavis.github.io/Binary-Light-Box/](https://alexanderedavis.github.io/Binary-Light-Box/) - -## Use as Extension - -This repository can be added as an **extension** in MakeCode. - -* open [https://makecode.microbit.org/](https://makecode.microbit.org/) -* click on **New Project** -* click on **Extensions** under the gearwheel menu -* search for **https://github.com/alexanderedavis/binary-light-box** and import - -## Edit this project ![Build status badge](https://github.com/alexanderedavis/binary-light-box/workflows/MakeCode/badge.svg) - -To edit this repository in MakeCode. - -* open [https://makecode.microbit.org/](https://makecode.microbit.org/) -* click on **Import** then click on **Import URL** -* paste **https://github.com/alexanderedavis/binary-light-box** and click import - -## Blocks preview - -This image shows the blocks code from the last commit in master. -This image may take a few minutes to refresh. - -![A rendered view of the blocks](https://github.com/alexanderedavis/binary-light-box/raw/master/.github/makecode/blocks.png) - -#### Metadata (used for search, rendering) - -* for PXT/microbit - diff --git a/_config.yml b/_config.yml deleted file mode 100644 index f56a029..0000000 --- a/_config.yml +++ /dev/null @@ -1,8 +0,0 @@ -makecode: - target: microbit - platform: microbit - home_url: https://makecode.microbit.org/ -theme: jekyll-theme-slate -include: - - assets - - README.md diff --git a/main.blocks b/main.blocks deleted file mode 100644 index 9067326..0000000 --- a/main.blocks +++ /dev/null @@ -1 +0,0 @@ -DenaryitemcolumnscolumnValuesitem2sensePinsreadySerialPin.P0SerialPin.P16BaudRate.BaudRate9600sensePins0FALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEcolumns0FALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEcolumnValues01248163264128256Denary01Denaryready0TRUEupdateNumberDenary0item0MINUS0columns1TRUEcolumns0itemDenary0columnValues0item1DenaryupdateColumnitem20MINUS0columns11item2TRUEsensePins0item2switchSensorsTRUEEQ0DigitalPin.P11sensePins0TRUETRUEEQ0DigitalPin.P10sensePins0FALSETRUEEQ0DigitalPin.P21sensePins1TRUETRUEEQ0DigitalPin.P20sensePins1FALSETRUEEQ0DigitalPin.P31sensePins2TRUETRUEEQ0DigitalPin.P30sensePins2FALSETRUEEQ0DigitalPin.P41sensePins3TRUETRUEEQ0DigitalPin.P40sensePins3FALSETRUEEQ0DigitalPin.P61sensePins4TRUETRUEEQ0DigitalPin.P60sensePins4FALSETRUEEQ0DigitalPin.P71sensePins5TRUETRUEEQ0DigitalPin.P70sensePins5FALSETRUEEQ0DigitalPin.P81sensePins6TRUETRUEEQ0DigitalPin.P80sensePins6FALSETRUEEQ0DigitalPin.P91sensePins7TRUETRUEEQ0DigitalPin.P90sensePins7FALSETRUEEQ0DigitalPin.P101sensePins8TRUETRUEEQ0DigitalPin.P100sensePins8FALSEupdateFlagcolumnflagTRUEflagcolumns0columnTRUETRUETRUEflagcolumns0columnFALSEupdateDisplaynumber/numberTRUEready \ No newline at end of file diff --git a/main.py b/main.py deleted file mode 100644 index a2e5c48..0000000 --- a/main.py +++ /dev/null @@ -1,94 +0,0 @@ -function updateNumber () { - Denary = 0 - for (let item = 0; item <= columns.length - 1; item++) { - if (columns[item]) { - Denary += columnValues[item] - } - } - updateDisplay(Denary) -} -function updateColumn () { - for (let item = 0; item <= columns.length - 1; item++) { - updateFlag(item, sensePins[item]) - } -} -function switchSensors () { - if (pins.digitalReadPin(DigitalPin.P1) == 1) { - sensePins[0] = true - } else if (pins.digitalReadPin(DigitalPin.P1) == 0) { - sensePins[0] = false - } - if (pins.digitalReadPin(DigitalPin.P2) == 1) { - sensePins[1] = true - } else if (pins.digitalReadPin(DigitalPin.P2) == 0) { - sensePins[1] = false - } - if (pins.digitalReadPin(DigitalPin.P3) == 1) { - sensePins[2] = true - } else if (pins.digitalReadPin(DigitalPin.P3) == 0) { - sensePins[2] = false - } - if (pins.digitalReadPin(DigitalPin.P4) == 1) { - sensePins[3] = true - } else if (pins.digitalReadPin(DigitalPin.P4) == 0) { - sensePins[3] = false - } - if (pins.digitalReadPin(DigitalPin.P6) == 1) { - sensePins[4] = true - } else if (pins.digitalReadPin(DigitalPin.P6) == 0) { - sensePins[4] = false - } - if (pins.digitalReadPin(DigitalPin.P7) == 1) { - sensePins[5] = true - } else if (pins.digitalReadPin(DigitalPin.P7) == 0) { - sensePins[5] = false - } - if (pins.digitalReadPin(DigitalPin.P8) == 1) { - sensePins[6] = true - } else if (pins.digitalReadPin(DigitalPin.P8) == 0) { - sensePins[6] = false - } - if (pins.digitalReadPin(DigitalPin.P9) == 1) { - sensePins[7] = true - } else if (pins.digitalReadPin(DigitalPin.P9) == 0) { - sensePins[7] = false - } - if (pins.digitalReadPin(DigitalPin.P10) == 1) { - sensePins[8] = true - } else if (pins.digitalReadPin(DigitalPin.P10) == 0) { - sensePins[8] = false - } -} -function updateFlag (column: number, flag: boolean) { - if (flag) { - columns[column] = true - } else if (!(flag)) { - columns[column] = false - } -} -function updateDisplay (number: number) { - serial.writeString("/") - serial.writeNumber(number) -} -let Denary = 0 -let columnValues: number[] = [] -let columns: boolean[] = [] -let sensePins: boolean[] = [] -serial.redirect( -SerialPin.P0, -SerialPin.P16, -BaudRate.BaudRate9600 -) -sensePins = [false, false, false, false, false, false, false, false, false] -columns = [false, false, false, false, false, false, false, false, false] -columnValues = [1, 2, 4, 8, 16, 32, 64, 128, 256] -Denary = 0 -updateDisplay(Denary) -let ready = true -basic.forever(function () { - if (ready) { - switchSensors() - updateColumn() - updateNumber() - } -}) diff --git a/main.ts b/main.ts deleted file mode 100644 index 74c646a..0000000 --- a/main.ts +++ /dev/null @@ -1,94 +0,0 @@ -function updateNumber () { - Denary = 0 - for (let item = 0; item <= columns.length - 1; item++) { - if (columns[item]) { - Denary += columnValues[item] - } - } - updateDisplay(Denary) -} -function updateColumn () { - for (let item2 = 0; item2 <= columns.length - 1; item2++) { - updateFlag(item2, sensePins[item2]) - } -} -function switchSensors () { - if (pins.digitalReadPin(DigitalPin.P1) == 1) { - sensePins[0] = true - } else if (pins.digitalReadPin(DigitalPin.P1) == 0) { - sensePins[0] = false - } - if (pins.digitalReadPin(DigitalPin.P2) == 1) { - sensePins[1] = true - } else if (pins.digitalReadPin(DigitalPin.P2) == 0) { - sensePins[1] = false - } - if (pins.digitalReadPin(DigitalPin.P3) == 1) { - sensePins[2] = true - } else if (pins.digitalReadPin(DigitalPin.P3) == 0) { - sensePins[2] = false - } - if (pins.digitalReadPin(DigitalPin.P4) == 1) { - sensePins[3] = true - } else if (pins.digitalReadPin(DigitalPin.P4) == 0) { - sensePins[3] = false - } - if (pins.digitalReadPin(DigitalPin.P6) == 1) { - sensePins[4] = true - } else if (pins.digitalReadPin(DigitalPin.P6) == 0) { - sensePins[4] = false - } - if (pins.digitalReadPin(DigitalPin.P7) == 1) { - sensePins[5] = true - } else if (pins.digitalReadPin(DigitalPin.P7) == 0) { - sensePins[5] = false - } - if (pins.digitalReadPin(DigitalPin.P8) == 1) { - sensePins[6] = true - } else if (pins.digitalReadPin(DigitalPin.P8) == 0) { - sensePins[6] = false - } - if (pins.digitalReadPin(DigitalPin.P9) == 1) { - sensePins[7] = true - } else if (pins.digitalReadPin(DigitalPin.P9) == 0) { - sensePins[7] = false - } - if (pins.digitalReadPin(DigitalPin.P10) == 1) { - sensePins[8] = true - } else if (pins.digitalReadPin(DigitalPin.P10) == 0) { - sensePins[8] = false - } -} -function updateFlag (column: number, flag: boolean) { - if (flag) { - columns[column] = true - } else if (!(flag)) { - columns[column] = false - } -} -function updateDisplay (number: number) { - serial.writeString("/") - serial.writeNumber(number) -} -let Denary = 0 -let columnValues: number[] = [] -let columns: boolean[] = [] -let sensePins: boolean[] = [] -serial.redirect( -SerialPin.P0, -SerialPin.P16, -BaudRate.BaudRate9600 -) -sensePins = [false, false, false, false, false, false, false, false, false] -columns = [false, false, false, false, false, false, false, false, false] -columnValues = [1, 2, 4, 8, 16, 32, 64, 128, 256] -Denary = 0 -updateDisplay(Denary) -let ready = true -basic.forever(function () { - if (ready) { - switchSensors() - updateColumn() - updateNumber() - } -}) diff --git a/pxt.json b/pxt.json deleted file mode 100644 index 8e5fbdc..0000000 --- a/pxt.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "Binary Box", - "version": "1.0.0", - "description": "", - "dependencies": { - "core": "*", - "microphone": "*" - }, - "files": [ - "main.blocks", - "main.ts", - "README.md", - "main.py" - ], - "testFiles": [], - "supportedTargets": [ - "microbit" - ], - "preferredEditor": "blocksprj" -} diff --git a/test.ts b/test.ts deleted file mode 100644 index 7bf240c..0000000 --- a/test.ts +++ /dev/null @@ -1 +0,0 @@ -// tests go here; this will not be compiled when this package is used as an extension. diff --git a/tsconfig.json b/tsconfig.json deleted file mode 100644 index a2079ff..0000000 --- a/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "target": "es5", - "noImplicitAny": true, - "outDir": "built", - "rootDir": "." - }, - "exclude": ["pxt_modules/**/*test.ts"] -}