the start of some experimentation

Dependencies:   microbit

Files at this revision

API Documentation at this revision

Comitter:
matrixmike
Date:
Sat Oct 19 08:06:36 2019 +0000
Commit message:
initial commit

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
microbit.lib Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 772b1f247008 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sat Oct 19 08:06:36 2019 +0000
@@ -0,0 +1,24 @@
+/* See 
+ * http://lancaster-university.github.io/microbit-docs/advanced/ 
+ * for docs about using the micro:bit library
+*/
+#include "MicroBit.h"
+
+MicroBitMessageBus bus;
+MicroBitButton buttonA(MICROBIT_PIN_BUTTON_A, MICROBIT_ID_BUTTON_A);
+MicroBitDisplay display;
+
+void onPressed(MicroBitEvent e)
+{
+    display.print("S");    
+}
+
+int main()
+{
+    scheduler_init(bus);
+
+    bus.listen(MICROBIT_ID_BUTTON_A, MICROBIT_BUTTON_EVT_CLICK, onPressed);
+
+    while(1)
+        fiber_sleep(1000);
+}
\ No newline at end of file
diff -r 000000000000 -r 772b1f247008 microbit.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/microbit.lib	Sat Oct 19 08:06:36 2019 +0000
@@ -0,0 +1,1 @@
+https://developer.mbed.org/teams/Lancaster-University/code/microbit/#4b89e7e3494f