Raspberry BASIC

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Richard Russell

Pages: 1 2 3 [4] 5
46
BBC BASIC / BBC BASIC for SDL 2.0 version 1.12a released
« on: May 08, 2020, 05:18:29 PM »
I've released version 1.12a of BBC BASIC for SDL 2.0 - the cross-platform programming language for Windows, MacOS, Linux, Raspbian, Android and iOS.  The changes in this version are as follows:
  • BASIC Interpreter / Run Time Engine

    Updated the MacOS edition (only) to SDL 2.0.12 to fix some graphical glitches.

    Enabled render batching in the iOS edition (deferred from 1.11a because of a compatibility issue).

    Improved the Windows edition's compatibility with the username containing non-ASCII characters.

  • IDEs and Utilities

    In the SDLIDE file selector, starting to type the wanted filename scrolls the listbox.

    Updated BBCEdit to version 0.34.2 (thanks to Andy Parkes).

    Updated touchide to support copying-and-pasting entire directories.

    Fixed a memory leak in SDLIDE's Compile utility.

    When SDLIDE is used with BBC BASIC for Windows the Compile utility now works (it calls the BB4W compiler).

  • Libraries

    Added the imglib library for rotating, scaling and flipping 2D images efficiently (a highly compatible library is also available for BBC BASIC for Windows).

    Modified the filedlg library so that starting to type the wanted filename scrolls the listbox.

    Added FN_utf8_to_ansi() and FN_ansi_to_utf8() functions to the utf8lib library.

    Fixed a bug in the box2dgfx library affecting non-zero y-origin values when PROC_gfxMatrix is used.

  • Example Programs

    Added bbclock.bbc (in examples/physics), a graphical Box2D simulation of a 'Ball Bearing Clock'.  This program is compatible with BBC BASIC for Windows if the Box2D libraries are installed.

    Added dunebuggy.bbc (in examples/physics), a Box2D demo of a vehicle with sprung suspension.  This program is compatible with BBC BASIC for Windows if the Box2D libraries are installed.

    Added kerning.bbc (in examples/general/) to demonstrate the effect of kerning.  This program is compatible with BB4W.

    Modified aliens.bbc to use the new imglib library; this also makes it compatible with BB4W, but without hardware acceleration it runs only slowly.

    Fixed a bug in SkyBaby.bbc affecting some editions (e.g. Android but not Windows), caused by a surprising anomaly in the 'asctime' and 'mktime' C runtime library routines.
This new version may be downloaded, for all the supported platforms, from the usual location.  The GitHub repository has been updated (used to build the MacOS, Raspbian, iOS and 64-bit Linux editions, currently).

47
BBC BASIC / BBC BASIC for SDL 2.0 version 1.11a released
« on: March 28, 2020, 09:57:11 AM »
I've released version 1.11a of BBC BASIC for SDL 2.0 - the cross-platform programming language for Windows, MacOS, Linux, Raspbian, Android and iOS.  The changes in this version are as follows:

  • BASIC Interpreter / Run Time Engine

    Enabled render batching (in SDL 2.0.10 and later) which should improve graphics performance.

    Rationalised the VDU variables, e.g. ?444 and @vdu%!248 no longer have their previous functions.

    Added @vdu.w{a&,b&,c&,d&}, @size{x%,y%} and @char{x%,y%} to mirror some system variables.

    32-bit x86 editions now support the 64-bit indirection operator (]) as 64-bit and ARM editions always have.

    VDU 27,n (output symbol for character codes 0-31 and 127) now works in VDU 5 as well as VDU 4 mode.

    Changed the default MODE 7 font to be more similar to RISC OS and Matrix Brandy.

    Fixed a bug causing BBCSDL not to run properly if the installation path contained a 'dot' character.

  • IDEs and Utilities

    Updated BBCEdit to version 0.32.4, which fixes a minor bug in the last release.

    Enhanced SDLIDE so that the Tab key inserts eight spaces in the editor.

    Fixed a bug in the Compiler utility which could cause crunching to fail with code containing both 32-bit and 64-bit versions of a structure (e.g. box2dlib.bbc is in this category).

    Fixed a bug in the Search BASIC Programs utility which could cause it to freeze in rare circumstances.

  • Libraries

    The ogllib and gleslib 3D graphics libraries have been modified to improve support for point-source, spot- and directional lights (compatible, as far as I can reasonably achieve, with BB4W).

    The ellipse library has been updated to be compatible with 'render batching'.

    The dlglib library has minor improvements to the textbox and listbox.

    Svein has updated his treeview library to version 3.08, which has improved performance.

  • Example Programs

    Added spotlight.bbc in examples/graphics to demonstrate the different light types available in OpenGL.

    Added pintograph.bbc in examples/physics, a Box2D simulation of a drawing machine originally by Svein Svensson.  This program is compatible with BB4W if the Box2D libraries are installed.

    Added trebuchet.bbc in examples/physics, a Box2D simulation of a trebuchet by David Marples.  This program is compatible with BB4W if the Box2D libraries are installed.

    Modified getri.bbc to report whether render batching is enabled.

    Updated tower.bbc to ensure compatibility with render batching.
This new version may be downloaded, for all the supported platforms, from the usual location.  The GitHub repository has been updated (used to build the MacOS, Raspbian, iOS and 64-bit Linux editions, currently).

Please remember that if you use the BBC2APK Android Application Generator you should download a new APK template to ensure that any updates to the run-time engine are incorporated in your own apps.

48
BBC BASIC / BBC BASIC for SDL 2.0 version 1.10a released
« on: February 15, 2020, 02:35:45 PM »
I've released version 1.10a of BBC BASIC for SDL 2.0 - the cross-platform programming language for Windows, MacOS, Linux, Raspbian, Android and iOS.  The changes in this version are as follows:

  •   BASIC Interpreter / Run Time Engine

    Bundled the Box2D physics engine (as famously used by the Angry Birds games) with all editions.

    Fixed a bug causing ON GOTO statements to be incorrectly tokenised (64-bit and ARM editions only).

    Improved plotting accuracy of 'thick' diagonal lines, outline circles and outline ellipses.

    Updated the Android edition to SDL 2.0.10.  This has necessitated moving to a different build process (Android Studio) meaning you will need to uninstall then reinstall; see below.

  •   IDEs and Utilities

    Updated BBCEdit to version 0.32.3, many thanks to Andy Parkes for this new release.

    Fixed a minor problem in SDLIDE with pasting Unicode text containing the à (a-grave) character.

    Fixed a bug in the Compiler utility which could cause creation of an app bundle to fail on MacOS if the installation path contains a space character.

    Modified the List Variables utility so that a mouse right-click clears the listbox selection.

  •   Libraries

    Added box2dlib.bbc and box2dgfx.bbc to support the Box2D physics engine.

    Fixed a bug in dlglib.bbc which affected the 'Save As' dialogue in SDLIDE, also improved operability by the Amazon Fire TV remote.

  •   Example Programs

    Added kaleidoscope.bbc in examples\graphics, adapted from David Williams's BB4W demo.

    Added three Box2D demonstration programs in examples\physics; these are also compatible with BBC BASIC for Windows if the Box2D libraries are installed:

     crates.bbc:  Falling boxes; on mobile devices tilting the screen has an interesting effect!
     dangle.bbc:  Touch the screen or use the mouse to grab the chain; also responds to tilting.
     lotto.bbc:   A simulation of a lottery selection machine.  Sorry, there's no prize if you win!

This new version may be downloaded, for all the supported platforms, from the usual location.  The GitHub repository has been updated (used to build the MacOS, Raspbian, iOS and 64-bit Linux editions, currently).

If you are using the iOS edition you should install this latest release to update the certificate, otherwise BBC BASIC will stop working when the current certificate expires on 23rd February.

If you are using the Android edition you will need to uninstall the previous version before installing this one.  Please check whether you have any personal files or folders stored in @usr$ and back them up (e.g. via a USB connection to a PC) so you can restore them after re-installation.

Please remember that if you use the BBC2APK Android Application Generator you should download a new APK template to ensure that any updates to the run-time engine are incorporated in your own apps.

49
BBC BASIC / Re: BBC BASIC for SDL 2.0 version 1.09a released
« on: January 18, 2020, 08:07:05 PM »
ScriptBasic core hasn't changed since 2005.

For some while my updates have principally been adding to or improving the IDE, libraries, tools and example programs rather than the 'core'.  It's one of the big differences between BBC BASIC for Windows and BBC BASIC for SDL 2.0 of course; in the former the IDE was written in C because at the time (18+ years ago) interpreted BASIC wasn't fast enough for that task.  Now, only the core interpreter needs to be written in assembler code and/or C, everything else (IDE, libraries, tools, utilities) can themselves be written in BASIC, because the performance is acceptable.

One valuable side-effect of all these add-ons being themselves coded in BASIC is that they are automatically CPU and OS-agnostic and will run on all the supported platforms without a build environment (C compiler, linker or whatever) - or the expertise to use it - needing to be available.

50
BBC BASIC / Re: BBC BASIC for SDL 2.0 version 1.09a released
« on: January 18, 2020, 05:21:34 PM »
Glad you're hanging in there keeping BASIC in the forefront.

I'm not sure for how much longer I'll be maintaining the current every-six-weeks (or so) release schedule.  BBC BASIC for SDL 2.0 is getting quite mature now and there's not much that its 'senior' cousin BBC BASIC for Windows can do that BBCSDL can't (apart, obviously, from Windows API-specific things).

One major upgrade which I do hope to achieve is support for the Box2D physics engine (famously behind the Angry Birds franchise) which has been available to BB4W programmers for some years but not yet to BBCSDL programmers.

51
BBC BASIC / BBC BASIC for SDL 2.0 version 1.09a released
« on: January 17, 2020, 11:33:56 PM »
I've released version 1.09a of BBC BASIC for SDL 2.0 - the cross-platform programming language for Windows, MacOS, Linux, Raspbian, Android and iOS.  The changes in this version are as follows:

  •   BASIC Interpreter / Run Time Engine

    Worked around a regression in SDL 2.0.10, which caused the fern demo not to run on some platforms.

    Improved compatibility with GCC 4.9.

  •   IDEs and Utilities

    SDLIDE: Added the Memory Usage Monitor (similar to the BB4W equivalent) to the Utilities menu.  Now you can find out how close your program is to running out of memory (or whether you have allocated much more memory than you need!).  The BASIC program must be run in Debug mode for this to work.

  •   Libraries

    Modified dlglib.bbc to improve the responsiveness of the listbox to slow mouse button clicks.

  •   Example Programs

    Updated Ceefax.bbc (and capitalised its name!) to include Weather, Traffic and Local News pages, and to be navigable using an Amazon Fire TV remote.  With the demise of the BBC's digital ('red button') text service at the end of this month, this is my attempt to provide a substitute!  This program also runs in BBC BASIC for Windows if you copy 'Bedstead-ext.otf' into BB4W's LIB directory.

This new version may be downloaded, for all the supported platforms, from the usual location.  The GitHub repository has been updated (used to build the MacOS, Raspbian, iOS and 64-bit Linux editions, currently).

Please remember that if you use the Android Application Generator you should download a new APK template to ensure that any updates to the run-time engine are incorporated in your own apps.

52
BBC BASIC / BBC BASIC for SDL 2.0 version 1.06a released
« on: September 03, 2019, 03:51:26 PM »
I have released version 1.06a of BBC BASIC for SDL 2.0, the cross-platform programming language for Windows, MacOS, Linux, Raspbian, Android and iOS.  The changes in this version are as follows:
  • BASIC Interpreter / Run Time Engine

    Added support for antialiased 2D graphics (extending SDL2_gfx).

    Increased the maximum number of float parameters that can be passed by SYS from 6 to 8.

    Fixed a bug in the PRINT statement whereby a comma didn't unset 'hex' mode (64-bit and ARM editions).

    Modified the ARM and x86-64 assemblers so that the 'Jump out of range' error is not reported on the first pass if the destination label has been made LOCAL.

    Modified the ARM assembler so that numeric values may be used as aliases for register names (this improves compatibility with Acorn's assembler).

  • Libraries

    Added 'aagfxlib.bbc' to support antialiased 2D graphics.  This is functionally very similar to the GDIPLIB library supplied with BBC BASIC for Windows.

  • Example Programs

    Added 'aagfxdem.bbc' (in the examples/graphics folder) to demonstrate antialiased graphics.

    Added 'knots.bbc' (in the examples/graphics folder), a Celtic Knot program by David Marples which also makes good use of antialiased graphics.

    Added 'BBSterm.bbc' (in the examples/general folder; desktop editions only) which is a terminal program for Bulletin Board Services accessed by 'telnet'.
This new version may be downloaded, for all the supported platforms, from the usual location.  The GitHub repository has been updated (used to build the MacOS, Raspbian, iOS and 64-bit Linux editions, currently).

53
BBC BASIC / BBC BASIC for SDL 2.0 version 1.05a released
« on: July 25, 2019, 02:54:02 PM »
I have released version 1.05a of BBC BASIC for SDL 2.0, the cross-platform programming language for Windows, MacOS, Linux, Raspbian (Raspberry Pi), Android and iOS.  The changes in this version are as follows:

  • BASIC Interpreter / Run Time Engine

        Fixed a bug causing MOUSE and graphics coordinates to diverge if the window is resized without doing a VDU 26.

        Incorporated Jonathan Harston's modification to ignore SOUND statements specifying non-internal sound channels.

  • IDEs and Utilities

        The SDLIDE list of functions and procedures can now be scrolled using the PgUp and PgDn keys.

        SDLIDE will now load programs in plain text (.bas) format even if they contain TAB characters.

        Added a Go To Line menu selection to SDLIDE, similar to that in BBC BASIC for Windows v6.12a.

        Modified the search utility to fix a problem with it not having keyboard focus initially.

  • Libraries

        dlglib.bbc now supports comboboxes!

        Fixed a bug in datelib.bbc causing the FN_date$() function to misbehave with months starting with an M (March and May).  D'oh!

        The DejaVuSans font has been updated to a newer version with more Unicode symbols.

        Added the (incomplete) bigint.bbc library in case somebody fancies developing it further.

  • Example Programs

        Added a graphics demo fluid.bbc which uses GPU shader code to create a plasma-like effect.

        Modified dlgdemo.bbc to demonstrate the new combobox capability of the dialogue box library.

        Modified hangman.bbc to remove code which worked around the now fixed coordinate disparity.

        Added a 3D animation to accompany skaters.bbc.  This has a rather risqué Easter Egg, can you find it?!
This new version may be downloaded, for all the supported platforms, from the usual location.  The GitHub repository has been updated (used to build the MacOS, Raspbian, iOS and 64-bit Linux editions, currently).

54
BBC BASIC / BBC BASIC for SDL 2.0 version 1.04a released
« on: June 24, 2019, 04:19:25 PM »
I have released version 1.04a of BBC BASIC for SDL 2.0, the cross-platform programming language for Windows, MacOS, Linux, Raspbian, Android and iOS.  The changes in this version are as follows:
  • BASIC Interpreter / Run Time Engine

    The VDU 23,24,n| command updates the 'character spacing adjustment' when a proportional-spaced font is used (negative values cause the characters to close up, positive values cause them to spread apart).

    The @tmp$ system variable has been changed on Linux (including Raspbian) and MacOS so that it points to a user-specific directory.  Previously, problems could arise if BBC BASIC was run as 'root' (causing files with root ownership to be stored in @tmp$) and then subsequently as a user without privileges to delete them.  On other platforms @tmp$ has always been user-specific.
  • Example Programs

    hangman.bbc: David Williams' nice hangman program, ported to BBCSDL whilst preserving its original look-and-feel as closely as possible.

    figleaf.bbc: A rendition of Scott Joplin's 'Fig Leaf Rag' (transcribed by Ron Stickley for my Z80 Music program in 1984) accompanied by an animated 3D piano keyboard.
This new version may be downloaded, for all the supported platforms, from the usual location.  The GitHub repository has been updated (used to build the MacOS, Raspbian, iOS and 64-bit Linux editions, currently) although doubts have been expressed over whether GitHub is the right solution going forwards.

Please remember that if you use the Android Application Generator you should download a new APK template to ensure that any updates to the run-time engine are incorporated in your own apps.

55
BBC BASIC / Re: Interfacing with a DHT11/12/22 sensor
« on: June 04, 2019, 08:18:41 AM »
It seems when you use the custom syntax highlighting option, Select All is no longer available. You can still select the text but you have to do it manually.

That's a pity.  I find manual selection difficult (on this laptop PC, at least), particularly if it needs to scroll; maybe if I had a proper mouse with a scrollwheel it would be easier.  It seems odd that one useful feature would be removed at the same time as adding another.  [I'd add a frown but emoticons are seemingly broken on this forum!]

56
BBC BASIC / Re: Interfacing with a DHT11/12/22 sensor
« on: June 03, 2019, 08:16:33 PM »
The syntax highlighting is great, thank you, but the 'Select All' option seems to have gone! It was there before, wasn't it, or did I imagine it?


57
BBC BASIC / Interfacing with a DHT11/12/22 sensor
« on: June 03, 2019, 04:21:14 PM »
The BBC BASIC program below interfaces with a DHT11/12 or DHT22 humidity and temperature sensor connected to a Raspberry Pi GPIO pin.  These sensors use a proprietary serial data format on a one-wire bidirectional bus, which has to be decoded in software.

Because of the variable latency associated with a user-mode program reading the GPIO, the data cannot always be decoded reliably.  The code uses a number of strategies to minimize this problem but mis-reads must be expected and dealt with (e.g. by means of retries) in any application using it.  Note that the DHT11/12 may be polled no faster than once per second and the DHT22 no faster than once every two seconds.

The code has been written to be functional rather than pretty!

Code: Text
  1.       REM DHT11/12/22 sensor interface for Raspberry Pi 3/3+ (Raspbian)
  2.       REM (c) Richard Russell, http://www.rtrussell.co.uk/, 03-Jun-2019
  3.  
  4.       INSTALL @lib$ + "gpiolib"
  5.       GPIO% = FN_gpio_setup
  6.       PIN% = 2 : REM BCM pin no.
  7.  
  8.       @% = &2010A
  9.       REPEAT
  10.         CASE FN_dht_read(GPIO%, PIN%, humidity, temperature) OF
  11.           WHEN 0: PRINT TIME$ "  Humidity = "; humidity "%, temperature = "; temperature "C"
  12.           WHEN 1: PRINT TIME$ "  DHT11/12/22 read failed: wrong number of transitions"
  13.           WHEN 2: PRINT TIME$ "  DHT11/12/22 read failed: checksum error"
  14.           WHEN 3: PRINT TIME$ "  DHT11/12/22 read failed: no response"
  15.         ENDCASE
  16.         WAIT 200
  17.       UNTIL FALSE
  18.       END
  19.  
  20.       REM Read from DHT11/12/22, G% is value returned from FN_gpio_setup, P% is BCM pin number:
  21.       DEF FN_dht_read(G%, P%, RETURN humidity, RETURN temperature)
  22.       LOCAL B%, C%, I%, J%, M%, N%, O%, T%, d&(), t%() : N% = 6000 : REM Adjust for CPU speed
  23.       DIM d&(4), t%(90), C% LOCAL N%*4 + 3
  24.       B% = G% + &34 : M% = 1 << P%
  25.  
  26.       REM Initialise the GPIO pin to be used, happens only on first call:
  27.       PRIVATE initialised
  28.       IF NOT initialised THEN
  29.         PROC_gpio_inp(G%, P%) : PROC_gpio_pull(G%, 2) : REM pull-up
  30.         PROC_gpio_pullclk0(G%, 1 << P%) : PROC_gpio_pullclk0(G%, 0)
  31.         initialised = TRUE
  32.         WAIT 10
  33.       ENDIF
  34.  
  35.       REM Send the start signal to the DHT11/12/22 and sample the data stream it responds with:
  36.       PROC_gpio_out(G%,P%) : G%!&28 = M% : REM Set data line to output and low
  37.       WAIT 2                             : REM Wait 20 ms
  38.       G%!&1C = M% : PROC_gpio_inp(G%,P%) : REM Set data line high and to input
  39.       FOR I% = C% TO C% + N%*4 STEP 4 !I%=!B% : NEXT : REM Sample at ~1 us intervals
  40.  
  41.       REM Scan the captured data for transitions and store their positions in an array:
  42.       FOR I% = C% + 32 TO C% + N%*4 STEP 4
  43.         IF !I% AND M% EOR O% t%(J%) = I% : O% EOR= M% : J% += 1 : IF J% > DIM(t%(),1) EXIT FOR
  44.       NEXT
  45.       IF J% < 5 THEN = 3 : REM If fewer than 5 transitions report no response
  46.       IF O% = 0 ERROR 100, "Sampling period not long enough to capture entire data stream"
  47.  
  48.       REM Measure the total 'low' time (except for the initial pulse) to establish timebase:
  49.       FOR I% = 1 TO J%-2 STEP 2 : T% += t%(I%+1) - t%(I%) : NEXT : T% DIV= 41
  50.  
  51.       REM If too few transitions attempt to infer where the missing pulse(s) was/were:
  52.       IF J% = 79 PROC_dht_fix(t%(), J%)
  53.       IF J% = 81 PROC_dht_fix(t%(), J%)
  54.       IF J% <> 83 THEN = 1 : REM Report uncorrectable wrong number of transitions
  55.  
  56.       REM Decode data using only the high-to-low transitions:
  57.       FOR I% = 0 TO 39 : d&(I% DIV 8) = d&(I% DIV 8) * 2 - ((t%(I%*2+3) - t%(I%*2+1) > 2 * T%)) : NEXT
  58.       IF d&(4) <> (SUM(d&()) - d&(4) AND &FF) THEN
  59.         REM If checksum error attempt to decode using only the low-to-high transitions:
  60.         FOR I% = 0 TO 39 : d&(I% DIV 8) = d&(I% DIV 8) * 2 - ((t%(I%*2+4) - t%(I%*2+2) > 2 * T%)) : NEXT
  61.       ELSE IF d&(4) <> (SUM(d&()) - d&(4) AND &FF) THEN ;
  62.         REM If still a checksum error attempt to decode using widths of high pulses:
  63.         FOR I% = 0 TO 39 : d&(I% DIV 8) = d&(I% DIV 8) * 2 - ((t%(I%*2+3) - t%(I%*2+2) > T%)) : NEXT
  64.       ENDIF
  65.       IF d&(4) <> (SUM(d&()) - d&(4) AND &FF) THEN = 2 : REM Report uncorrectable checksum error
  66.  
  67.       REM Get the humidity and temperature; REM or unREM as required for DHT11/12 or DHT22:
  68.       humidity = d&(0) + d&(1) / 10 : temperature = d&(2) + d&(3) / 10 : REM DHT11/12
  69.       REM humidity = (d&(0) * 256 + d&(1)) / 10 : REM DHT22
  70.       REM temperature = ((d&(2) AND &7F) * 256 + d&(3)) / 10 : IF d&(2) >= &80 temperature *= -1 : REM DHT22
  71.       = 0
  72.  
  73.       REM If the number of transitions was wrong attempt to insert the 'missing' pulse:
  74.       DEF PROC_dht_fix(t%(), RETURN J%)
  75.       LOCAL I%, M%, S%, T%
  76.       FOR I% = 1 TO J%-2 STEP 2
  77.         T% = t%(I%+1) - t%(I%)
  78.         IF T% > M% M% = T% : S% = I%
  79.       NEXT
  80.       FOR I% = J%+1 TO S%+3 STEP -1
  81.         t%(I%) = t%(I%-2)
  82.       NEXT
  83.       t%(S%+1) = t%(S%) + M% * 2 / 5 + 0.5 : REM new rising edge
  84.       t%(S%+2) = t%(S%) + M% * 3 / 5 + 0.5 : REM new falling edge
  85.       J% += 2
  86.       ENDPROC
  87.  

58
BBC BASIC / BBC BASIC for SDL 2.0 version 1.03a released
« on: May 13, 2019, 01:21:02 PM »
I have released version 1.03a of BBC BASIC for SDL 2.0, the cross-platform programming language for Windows, MacOS, Linux, Raspbian (Raspberry Pi), Android and iOS.  The changes in this version are as follows:

  • IDEs / Compiler

    BBCEdit: Andy Parkes' alternative IDE has been updated to fix a few bugs.

    SDLIDE: The Search BASIC Programs utility has been ported from BB4W and can be found in the Utilities menu.  It searches for a given string in both tokenised (.bbc) and plain-text (.bas) programs, recursively searching sub-directories.

  • BASIC Interpreter / Run Time Engine

    @dir$ and @lib$ now use backslash path delimiters consistently in Windows.  This is only a cosmetic change, since Windows will accept forward slashes at the API level, but eliminates an anomaly.

    Mouse wheel rotations are now ignored at the immediate-mode prompt and in the INPUT statement.

  • Libraries

    The dlglib.bbc library has been extended to support multi-column list boxes.

    The File Selector dialogue used in recorder.bbc and compiler.bbc has been hived-off into a separate library, filedlg.bbc, so that it is easier to use from other programs.

  • Example Programs

    mandel.bbc: This has been completely rewritten so that the calculations are performed on the GPU rather than the CPU, making it no longer x86-specific (and allowing it to run in iOS despite assembler code not being permitted).

This new version may be downloaded, for all the supported platforms, from the usual location.  The GitHub repository  has been updated (used to build the MacOS, Raspberry Pi, iOS and 64-bit Linux editions, currently).

59
BBC BASIC / Re: Simple GPIO demo
« on: April 30, 2019, 10:19:02 PM »
Have you had any luck with the RPi Sense HAT board? Will your GPIO library allow use of the Sense HAT emulator that comes with Raspbian?

I don't have a Sense HAT here.  My understanding is that it's an I2C device and therefore not really accessible via the GPIO (I know that the I2C clock and data lines appear on GPIO pins, but it would be a bit daft to try to interface with I2C devices that way!).   So to that extent my GPIO library isn't really relevant to the Sense HAT, but BBC BASIC could no doubt access it via the virtual I2C device at /dev/i2c-*.

60
BBC BASIC / Simple GPIO demo
« on: April 30, 2019, 05:00:57 PM »
This is a very simple demo of the Raspberry Pi's GPIO being controlled by BBC BASIC, using the supplied 'gpiolib' library.  It cycles through six of the outputs, setting each one high in sequence.  The code is listed below, and this is the result (with LEDs fitted to monitor the outputs):



Code: [Select]
      REM Initialise GPIO:
      INSTALL @lib$ + "gpiolib"
      GPIO% = FN_gpio_setup

      REM Pin numbers to activate, in sequence:
      DATA 17, 23, 25, 12, 16, 26

      REM Set to input first:
      RESTORE
      FOR I% = 1 TO 6
        READ pin%
        PROC_gpio_inp(GPIO%, pin%)
      NEXT

      REM Set pins to output:
      RESTORE
      FOR I% = 1 TO 6
        READ pin%
        PROC_gpio_out(GPIO%, pin%)
      NEXT

      REM Cycle LEDs in sequence:
      REPEAT
        RESTORE
        FOR I% = 1 TO 6
          READ pin%
          PROC_gpio_set(GPIO%, 2^pin%)
          WAIT 20
          PROC_gpio_clr(GPIO%, 2^pin%)
        NEXT
      UNTIL FALSE
      END

Pages: 1 2 3 [4] 5