Skip to content

Commit

Permalink
Add initial version of the DAL programme.
Browse files Browse the repository at this point in the history
  • Loading branch information
microbit-carlos committed Feb 29, 2024
1 parent c6b4b28 commit bd2fa66
Show file tree
Hide file tree
Showing 6 changed files with 92 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
yotta_targets/*
yotta_modules/*
build/*
*.hex
*.bin
*.DS_Store
5 changes: 5 additions & 0 deletions .yotta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"build": {
"target": "bbc-microbit-classic-gcc,https://github.com/lancaster-university/yotta-target-bbc-microbit-classic-gcc"
}
}
32 changes: 30 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,30 @@
# incompatible-error-programme
A simple BLE-enabled CODAL programme that scrolls error 927 (programme not compatible)
# Incompatible V1 Error Programme

A simple BLE-enabled DAL programme for micro:bit V1 that scrolls error code
927 on the display.

This programme is meant to be used with the
[Universal Hex Creator Tool](https://tech.microbit.org/software/universal-hex-creator/)
to include a micro:bit V1 hex file that scrolls the "not compatible" error code
for V2-only programmes.

## Dependencies

- [GNU Arm Embedded Toolchain](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads)
- [Git](https://git-scm.com)
- [CMake](https://cmake.org/download/)
- [Python 3](https://www.python.org/downloads/)
- [Ninja](https://ninja-build.org/)
- [Yotta](https://yottabuild.org/)

Or Docker.

## Build Instructions

```
yotta build
```

```
docker run -v $(pwd):/home --rm ghcr.io/carlosperate/microbit-toolchain:latest yotta build
```
18 changes: 18 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"microbit-dal": {
"bluetooth": {
"enabled": 1,
"pairing_mode": 1,
"private_addressing": 0,
"open": 0,
"whitelist": 1,
"advertising_timeout": 0,
"tx_power": 6,
"security_level": "SECURITY_MODE_ENCRYPTION_NO_MITM",
"event_service": 0,
"dfu_service": 1,
"partial_flashing": 1,
"device_info_service": 1
}
}
}
11 changes: 11 additions & 0 deletions module.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "error-programme",
"version": "1.0.0",
"description": "The micro:bit runtime common abstraction with examples.",
"license": "MIT",
"dependencies": {
"microbit": "lancaster-university/microbit#v2.1.1"
},
"targetDependencies": {},
"bin": "./src"
}
22 changes: 22 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#include "MicroBit.h"

MicroBit uBit;

const uint8_t error_face_[] {
1, 1, 0, 1, 1,
1, 1, 0, 1, 1,
0, 0, 0, 0, 0,
0, 1, 1, 1, 0,
1, 0, 0, 0, 1,
};
const MicroBitImage error_face(5, 5, error_face_);

int main() {
uBit.init();

while (true) {
uBit.display.print(error_face);
uBit.sleep(1000);
uBit.display.print("927");
}
}

0 comments on commit bd2fa66

Please sign in to comment.