Author |
Topic: Experimental Raspberry Pi version (Read 1599 times) |
|
Richard Russell
Administrator
member is offline


Posts: 803
|
 |
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.
|
|
Logged
|
|
|
|
Richard Russell
Administrator
member is offline


Posts: 803
|
 |
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. 
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.
|
|
Logged
|
|
|
|
Richard Russell
Administrator
member is offline


Posts: 803
|
 |
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.
|
|
Logged
|
|
|
|
jbk
New Member
member is offline


Posts: 12
|
 |
Re: Experimental Raspberry Pi version
« Reply #5 on: Mar 5th, 2017, 10:22pm » |
|
tank you Richard
|
|
Logged
|
|
|
|
|