Skip to content

Commit

Permalink
Publish Micro:bit UART extension
Browse files Browse the repository at this point in the history
Change-Id: I155484ec759cc997a6ea0376cb8fa2d62f8c35d3
  • Loading branch information
ewpatton committed Jul 28, 2023
1 parent c2461fb commit 999f8d9
Show file tree
Hide file tree
Showing 263 changed files with 7,690 additions and 1,905 deletions.
2 changes: 1 addition & 1 deletion docs/makepages.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
<Route path="microbitled" component={MicroBitLedPage} />
<Route path="microbitmagnetometer" component={MicroBitMagnetometerPage} />
<Route path="microbittemperature" component={MicroBitTemperaturePage} />
<Route path="microbituart" component={MicroBitUartPage} />
<Route path="microbituart" component={MicroBitUartSimplePage} />
</Route>
<Route path="arduino101">
<Route path="arduino101intro" component={Arduino101IntroPage} />
Expand Down
2 changes: 1 addition & 1 deletion docs/src/app/pages/MicroBitAccelerometer.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The accelerometer's report rate, or period, determines how frequently data will

## Properties

+ <a name="BluetoothDevice"></a>`BluetoothDevice` – The BluetoothLE component connected to the micro:bit device.
+ <a name="BluetoothDevice"></a>`BluetoothDevice` – The BluetoothLE component connected to the micro:bit device (setter).


![get Microbit_Accelerometer1 BluetoothDevice ](blocks/Microbit_Accelerometer.BluetoothDevice_getter.svg)
Expand Down
2 changes: 1 addition & 1 deletion docs/src/app/pages/MicroBitButton.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The <code>Microbit_Button</code> extension provides App Inventor with informatio

## Properties

+ <a name="BluetoothDevice"></a>`BluetoothDevice` – The BluetoothLE component connected to the micro:bit device.
+ <a name="BluetoothDevice"></a>`BluetoothDevice` – The BluetoothLE component connected to the micro:bit device (setter).


![get Microbit_Button1 BluetoothDevice ](blocks/Microbit_Button.BluetoothDevice_getter.svg)
Expand Down
2 changes: 1 addition & 1 deletion docs/src/app/pages/MicroBitDeviceInformation.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The <code>Microbit_Device_Information</code> extension provides App Inventor wit

## Properties

+ <a name="BluetoothDevice"></a>`BluetoothDevice`
+ <a name="BluetoothDevice"></a>`BluetoothDevice`Property for BluetoothDevice


![get Microbit_Device_Information1 BluetoothDevice ](blocks/Microbit_Device_Information.BluetoothDevice_getter.svg)
Expand Down
2 changes: 1 addition & 1 deletion docs/src/app/pages/MicroBitDfuControl.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Component for Microbit_Dfu_Control

## Properties

+ <a name="BluetoothDevice"></a>`BluetoothDevice`
+ <a name="BluetoothDevice"></a>`BluetoothDevice`Property for BluetoothDevice


![get Microbit_Dfu_Control1 BluetoothDevice ](blocks/Microbit_Dfu_Control.BluetoothDevice_getter.svg)
Expand Down
2 changes: 1 addition & 1 deletion docs/src/app/pages/MicroBitEvent.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Component for Microbit_Event

## Properties

+ <a name="BluetoothDevice"></a>`BluetoothDevice`
+ <a name="BluetoothDevice"></a>`BluetoothDevice`Property for BluetoothDevice


![get Microbit_Event1 BluetoothDevice ](blocks/Microbit_Event.BluetoothDevice_getter.svg)
Expand Down
2 changes: 1 addition & 1 deletion docs/src/app/pages/MicroBitGenericAccess.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Component for Microbit_Generic_Access

## Properties

+ <a name="BluetoothDevice"></a>`BluetoothDevice`
+ <a name="BluetoothDevice"></a>`BluetoothDevice`Property for BluetoothDevice


![get Microbit_Generic_Access1 BluetoothDevice ](blocks/Microbit_Generic_Access.BluetoothDevice_getter.svg)
Expand Down
2 changes: 1 addition & 1 deletion docs/src/app/pages/MicroBitGenericAttribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Component for Microbit_Generic_Attribute

## Properties

+ <a name="BluetoothDevice"></a>`BluetoothDevice`
+ <a name="BluetoothDevice"></a>`BluetoothDevice`Property for BluetoothDevice


![get Microbit_Generic_Attribute1 BluetoothDevice ](blocks/Microbit_Generic_Attribute.BluetoothDevice_getter.svg)
Expand Down
4 changes: 2 additions & 2 deletions docs/src/app/pages/MicroBitIntro.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

The micro:bit is a computing platform from the BBC. It is an open platform for developing all manner of projects and is programmable by many different editors, including a <a href="https://pxt.microbit.org" target="_blank" rel="nofollow">blocks editor</a> provided by Microsoft. Learn more about the micro:bit at the <a rel="nofollow" href="http://microbit.org/about/" target="_blank">Micro:bit Educational Foundation's website</a>.

<a href="/assets/resources/SimpleMicrobit.aix">Download the BBC micro:bit extension</a>
<a href="/assets/resources/com.bbc.microbit.profile.aix">Download the BBC micro:bit extension</a> (version 20200518)

<div style="text-align: center; font-size: 75%; margin: 16pt 0;">
![micro:bit Front Image](./images/microbit-front.png)
Expand All @@ -22,4 +22,4 @@ MIT App Inventor has built a set of extensions to allow apps created with MIT Ap
* [Microbit_Led](#/microbit/microbitled) - print strings and custom images to the micro:bit's LED matrix.
* [Microbit_Magnetometer](#/microbit/microbitmagnetometer) - get heading/bearing information from the micro:bit.
* [Microbit_Temperature](#/microbit/microbittemperature) - get external temperature readings (in degrees Celsius) from the micro:bit.
* [Microbit_Uart](#/microbit/microbituart) - send and receive messages using the software serial port (UART) interface for the micro:bit. This can be used to send messages to custom software installed on the micro:bit.
* [Microbit_Uart\_Simple](#/microbit/microbituart) - send and receive messages using the software serial port (UART) interface for the micro:bit. This can be used to send messages to custom software installed on the micro:bit.
2 changes: 1 addition & 1 deletion docs/src/app/pages/MicroBitIoPin.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The <code>Microbit_Io_Pin</code> component lets users configure the BBC micro:bi

## Properties

+ <a name="BluetoothDevice"></a>`BluetoothDevice` – The BluetoothLE component connected to the micro:bit device.
+ <a name="BluetoothDevice"></a>`BluetoothDevice` – The BluetoothLE component connected to the micro:bit device (setter).


![get Microbit_Io_Pin1 BluetoothDevice ](blocks/Microbit_Io_Pin.BluetoothDevice_getter.svg)
Expand Down
14 changes: 13 additions & 1 deletion docs/src/app/pages/MicroBitIoPinSimple.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The <code>Microbit_Io_Pin</code> component lets users configure the BBC micro:bi

## Properties

+ <a name="BluetoothDevice"></a>`BluetoothDevice` – The BluetoothLE component connected to the micro:bit device.
+ <a name="BluetoothDevice"></a>`BluetoothDevice` – The BluetoothLE component connected to the micro:bit device (setter).


![get Microbit_Io_Pin_Simple1 BluetoothDevice ](blocks/Microbit_Io_Pin_Simple.BluetoothDevice_getter.svg)
Expand Down Expand Up @@ -34,10 +34,22 @@ The <code>Microbit_Io_Pin</code> component lets users configure the BBC micro:bi

![call Microbit_Io_Pin_Simple1 WriteOutputPinDatapinNumberpinValue](blocks/Microbit_Io_Pin_Simple.WriteOutputPinData.svg)

+ <a name="WritePWMControl"></a>`WritePWMControl` – Method for WritePWMControl

![call Microbit_Io_Pin_Simple1 WritePWMControlpinNumbervalueperiod](blocks/Microbit_Io_Pin_Simple.WritePWMControl.svg)

## Events

+ <a name="InputPinDataReceived"></a>`InputPinDataReceived` – Event for InputPinDataReceived

![when Microbit_Io_Pin_Simple1 InputPinDataReceived IO_Pin_Data do](blocks/Microbit_Io_Pin_Simple.InputPinDataReceived.svg)

+ <a name="WroteOutputPinData"></a>`WroteOutputPinData` – Event for WroteOutputPinData

![when Microbit_Io_Pin_Simple1 WroteOutputPinData IO_Pin_Data do](blocks/Microbit_Io_Pin_Simple.WroteOutputPinData.svg)

+ <a name="WrotePWMControl"></a>`WrotePWMControl` – Event for WrotePWMControl

![when Microbit_Io_Pin_Simple1 WrotePWMControl PWM_Control_Field do](blocks/Microbit_Io_Pin_Simple.WrotePWMControl.svg)


4 changes: 2 additions & 2 deletions docs/src/app/pages/MicroBitLed.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The <code>Microbit_LED</code> extension provides App Inventor users with the abi

## Properties

+ <a name="BluetoothDevice"></a>`BluetoothDevice` – The BluetoothLE component connected to the micro:bit device.
+ <a name="BluetoothDevice"></a>`BluetoothDevice` – The BluetoothLE component connected to the micro:bit device (setter).


![get Microbit_Led1 BluetoothDevice ](blocks/Microbit_Led.BluetoothDevice_getter.svg)
Expand Down Expand Up @@ -69,7 +69,7 @@ The <code>Microbit_LED</code> extension provides App Inventor users with the abi
+ <a name="LEDMatrixStateReceived"></a>`LEDMatrixStateReceived` – The <code>LEDMatrixStateReceived</code> event is run when the state of the micro:bit's LED
matrix is read from the device. The <code>LED_Matrix_State</code> is a list of 5 values, one
for each row of the matrix. Each value is an number from 0-31. From left to right, the LEDs
are valued 16, 8, 4, 2, 1.<br>\n\n
are valued 16, 8, 4, 2, 1.<br>

__Parameters__:

Expand Down
2 changes: 1 addition & 1 deletion docs/src/app/pages/MicroBitMagnetometer.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The <code>Microbit_Magnetometer</code> provides the ability to configure the BBC

## Properties

+ <a name="BluetoothDevice"></a>`BluetoothDevice` – The BluetoothLE component connected to the micro:bit device.
+ <a name="BluetoothDevice"></a>`BluetoothDevice` – The BluetoothLE component connected to the micro:bit device (setter).


![get Microbit_Magnetometer1 BluetoothDevice ](blocks/Microbit_Magnetometer.BluetoothDevice_getter.svg)
Expand Down
2 changes: 1 addition & 1 deletion docs/src/app/pages/MicroBitTemperature.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The temperature sensor's reportrate, or period, determines how frequently data w

## Properties

+ <a name="BluetoothDevice"></a>`BluetoothDevice` – The BluetoothLE component connected to the micro:bit device.
+ <a name="BluetoothDevice"></a>`BluetoothDevice` – The BluetoothLE component connected to the micro:bit device (setter).


![get Microbit_Temperature1 BluetoothDevice ](blocks/Microbit_Temperature.BluetoothDevice_getter.svg)
Expand Down
2 changes: 1 addition & 1 deletion docs/src/app/pages/MicroBitUart.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The <code>Microbit_Uart</code> sensor provides the ability to read from and writ

## Properties

+ <a name="BluetoothDevice"></a>`BluetoothDevice` – The BluetoothLE component connected to the micro:bit device.
+ <a name="BluetoothDevice"></a>`BluetoothDevice` – The BluetoothLE component connected to the micro:bit device (setter).


![get Microbit_Uart1 BluetoothDevice ](blocks/Microbit_Uart.BluetoothDevice_getter.svg)
Expand Down
53 changes: 53 additions & 0 deletions docs/src/app/pages/MicroBitUartSimple.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Microbit\_Uart\_Simple

The <code>Microbit_Uart_Simple</code> sensor provides the ability to read from and write strings to the BBC micro:bit's serial UART port.

## Properties

+ <a name="BluetoothDevice"></a>`BluetoothDevice` – The BluetoothLE component connected to the micro:bit device (setter).


![get Microbit_Uart_Simple1 BluetoothDevice ](blocks/Microbit_Uart_Simple.BluetoothDevice_getter.svg)


![set Microbit_Uart_Simple1 BluetoothDevice  to](blocks/Microbit_Uart_Simple.BluetoothDevice_setter.svg)

## Methods

+ <a name="SendMessage"></a>`SendMessage` – Writes the given value <code>UART_TX</code> to the micro:bit. The size of the message will
depend on the value of <code>UART_TX</code>. Numbers will be converted to integers and sent
as 32-bit integer values. Strings will be encoded using UTF-8. Lists of objects will be
sent as a sequence of bytes using the aforementioned rules for numbers and strings.

__Parameters__:

* <code>UART_TX</code> (_any_) &mdash;
The value to transmit to the RX "pin" of the micro:bit. Strings will be encoded as UTF-8,
numbers will be sent as 32-bit integers. Lists of values will be converted into be
converted into a sequence of bytes depending on the type of each value in the list.

![call Microbit_Uart_Simple1 SendMessagemessage](blocks/Microbit_Uart_Simple.SendMessage.svg)

## Events

+ <a name="MessageReceived"></a>`MessageReceived` – The <code>TXCharacteristicReceived</code> event is run whenever messages are received over the
micro:bit's serial UART protocol.

__Parameters__:

* <code>message</code> (<a href="http://appinventor.mit.edu/explore/ai2/support/blocks/listsU.html#makealist">_list_</a>) &mdash;
A list of unsigned byte values read from the device.

![when Microbit_Uart_Simple1 MessageReceived message do](blocks/Microbit_Uart_Simple.MessageReceived.svg)

+ <a name="MessageSent"></a>`MessageSent` – The <code>WroteRXCharacteristic</code> event is run after a message is written to the micro:bit
via its serial UART.

__Parameters__:

* <code>UART_TX_FIELD</code> (<a href="http://appinventor.mit.edu/explore/ai2/support/blocks/listsU.html#makealist">_list_</a>) &mdash;
A list of unsigned byte values written to the device.

![when Microbit_Uart_Simple1 MessageSent message do](blocks/Microbit_Uart_Simple.MessageSent.svg)


Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions docs/src/www/assets/resources/com.bbc.microbit.profile.aix
16 changes: 8 additions & 8 deletions docs/src/www/blocks/Microbit.AccelerometerDataReceived.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 999f8d9

Please sign in to comment.