BBC BASIC
« Experimental Raspberry Pi version »

Welcome Guest. Please Login or Register.
Oct 24th, 2017, 11:09am


Cross-platform BBC BASIC (Win32, Linux x86, Android, Mac OS-X, Raspberry Pi)

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Experimental Raspberry Pi version  (Read 1038 times)
michael
Full Member
ImageImageImage


member is offline

Avatar




PM


Posts: 101
xx Re: Experimental Raspberry Pi version
« Reply #1 on: Feb 17th, 2017, 01:24am »

I was planning to get a Raspberry pie . Have you tried controlling the pins on the device?
User IP Logged

I like reinventing the wheel, but for now I will work on tools for D3D
Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 605
xx Re: Experimental Raspberry Pi version
« Reply #2 on: Feb 17th, 2017, 09:26am »

on Feb 17th, 2017, 01:24am, michael wrote:
Have you tried controlling the pins on the device?

No (my RPi is in a case and the pins aren't accessible anyway). But assuming they are controllable via some documented API I can see no obvious reason why it shouldn't be callable from BBC BASIC using SYS.

Richard.
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 605
xx Re: Experimental Raspberry Pi version
« Reply #3 on: Feb 18th, 2017, 12:02pm »

Having today fully updated my Raspberry Pi 3 (rpi-update / apt-get update / apt-get dist-upgrade) I am pleased to report that the 'experimental' GL Driver (enabled in raspi-config) now works successfully with my TV, and the performance of BBC BASIC is much improved as a result. Graphics programs like 'bounce.bbc', 'chain.bbc' and 'prompter.bbc' now run at a much more acceptable speed. smiley

However true 3D programs, which rely on OpenGL, are still not working (they no longer crash, but don't display correctly). I will report back if I discover a fix.

Richard.
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 605
xx Re: Experimental Raspberry Pi version
« Reply #4 on: Mar 4th, 2017, 4:04pm »

on Feb 17th, 2017, 01:24am, michael wrote:
I was planning to get a Raspberry pie . Have you tried controlling the pins on the device?

The latest release of BBC BASIC for the Raspberry Pi comes with a new 'gpiolib' library which allows you to access the GPIO pins very easily. Here's a simple demo/test program:

Code:
      REM Simple GPIO test program for the Raspberry Pi 2, RPi 3 or RPi Zero

      INSTALL @lib$ + "gpiolib"
      INSTALL @lib$ + "stringlib"

      REM Initialise GPIO:
      gpio% = FN_gpio_setup

      REM Set GPIO pins 7 to 11 inclusive to output mode:
      FOR pin% = 7 TO 11
        PROC_gpio_inp(gpio%,pin%) : REM Must use PROC_gpio_inp() before PROC_gpio_out()
        PROC_gpio_out(gpio%,pin%)
      NEXT pin%

      REM Set GPIO pins 24 and 25 to input mode:
      FOR pin% = 24 TO 25
        PROC_gpio_inp(gpio%,pin%)
      NEXT pin%

      REM Enable pull-ups on GPIO pins 24 and 25:
      PROC_gpio_pull(gpio%,2) : REM Select pull-up
      WAIT 0
      PROC_gpio_pullclk0(gpio%,&3000000)
      WAIT 0
      PROC_gpio_pull(gpio%,0)
      PROC_gpio_pullclk0(gpio%,0)

      REM Output a cycling pattern to GPIO pins 7 to 11:
      previous% = %111110000000
      FOR pattern% = %000000000000 TO %111110000000 STEP %10000000
        PROC_gpio_clr(gpio%, (pattern% EOR previous%) AND NOT pattern%)
        PROC_gpio_set(gpio%, (pattern% EOR previous%) AND pattern%)
        previous% = pattern%
        WAIT 20
        PRINT FN_tobase(gpio%!&34 >> 7 AND %11111, 2, 5)
      NEXT pattern%

      END 

Richard.
User IP Logged

jbk
New Member
Image


member is offline

Avatar




PM


Posts: 12
xx Re: Experimental Raspberry Pi version
« Reply #5 on: Mar 5th, 2017, 10:22pm »

tank you Richard smiley
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

Donate $6.99 for 50,000 Ad-Free Pageviews!


This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls