Oberon Examples
The source code of these examples is located in your AstrobeRP2040-v9.3\Examples folders. You will find additional source code examples on the Astrobe Forum.
The example programs which are shown with screenshots below use the Astrobe Out library module to generate text output and send it via a UART port on the development board to a COM port on the PC where it is displayed on the Astrobe terminal window. The examples have been tested on the supported RP2040 development boards. They allow the serial communication to be performed via a virtual COM port using a USB cable to connect the board to the PC.
Filename | Description |
---|---|
Info.mod |
System Info Outputs the clock configuration, linker and startup parameters specified for the current application and shows the amount of RAM remaining for use by the program. |
ViewMemory.mod |
ViewMemory Outputs the contents of the first 64 words of memory starting from address Data Start and then the last 64 words of memory up to address Data End. Each line of output contains the address and the contents of the next 4-word block of data displayed in Hexadecimal format. |
TestTraps.mod |
TestTraps Demonstrates the trapping and display of runtime errors. |
UserTraps.mod |
UserTraps Demonstrates the trapping and user-defined display of runtime errors. |
TestBits.mod Bits.mod |
TestBits Shows the results of example calls to the procedures in the Bits library module.
|
TestReals.mod Reals.mod |
TestReals Shows the results of example calls to the procedures in the Reals library module.
|
TestStrings.mod Strings.mod |
TestStrings Shows the results of example calls to the procedures in the Strings library module.
|
ByteArrays.mod VALByteArrays.mod |
ByteArrays Demonstrates the use of variables declared as ARRAY n OF BYTE to simplify and optimise the code required for tasks such as de-serialising / serialising complex data structures for Input / Output operations. VALByteArrays As above but using SYSTEM.VAL instead of ARRAY n OF BYTE. |
Extensions.mod ExtensionsCase.mod ExtensionsProc.mod Lists.mod |
Extensions Shows three different ways to use Oberon's Type Extension feature to create and scan a dynamic list of a variety of objects. Lists contains the generic functions to build and traverse a list of objects. Extensions contains definitions for a number of related objects. The examples used are shapes e.g. circles, rectangles etc. The application first builds a list of different shapes and then scans the list displaying the relevant dimensions and area of each shape. Extensions uses the IS operator to perform the type tests in association with type guards. ExtensionsCase uses a CASE statement to perform the type tests and selections. ExtensionsProc uses procedure variables as record fields to perform type-specific actions for the different record extensions. |
Blinker.mod |
Blinker Blinks an LED once per second using a timer. You may have to change the pin configuration-related statements depending on which pins your LEDs are connected to. See the Getting Started section of the Astrobe Help file for more information. |
IRQBlinker.mod IRQTimer.mod |
IRQ Blinker LED blinks approx. once per second as a result of interrupt requests (IRQ) generated by a timer. |
ShowTime.mod RTC.mod Time.mod |
Set and Display the Real Time Clock
Prompts for the input of the current time (hours, minutes and seconds) and then displays the updated time every second.
|
HCTest.mod HCConfig.mod HCDir.mod HCFiles.mod HCDrive.mod |
HCFiler Filesystem: HCTest Initialise an HCFiler filesystem and create a number of test files on an SDHC Card accessed via SPI.
|
HCReadSpeed.mod HCConfig.mod HCDir.mod HCDrive.mod |
HCFiler Filesystem: HCReadSpeed Time SDHC card sector reading speed on an HCFiler filesystem accessed via SPI.
|
Licence Agreement
Astrobe for RP2040 Examples Source Code
Copyright © 2006-2024 CFB Software.
https://www.astrobe.com
Permission to use, copy, modify, and/or distribute these examples in source code form (the "Software") for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
DISCLAIMER
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THE SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES OR LIABILITY WHATSOEVER, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE DEALINGS IN OR USE OR PERFORMANCE OF THE SOFTWARE.