Anyone tried B4R (Basic) for Arduino with STM32?


ahull
Mon Jun 13, 2016 4:25 pm
Install Microsoft .Net Framework 4+ (it is already installed on most computers)

I’m out. :roll:


starchild
Tue Jun 14, 2016 10:45 am
I’ve had some success getting stm32 Nuceo F1 board compiling and running under B4R.

check my earlier posting
http://www.stm32duino.com/viewtopic.php … 745#p14745
It contains a brief list of mods to get it all going.


mrburnette
Tue Jun 14, 2016 12:19 pm
starchild wrote:
<….>
It contains a brief list of mods to get it all going.

simonf
Mon Jun 20, 2016 12:28 am
mrburnette wrote:
Other than as a diversion and a few special use-cases, BASIC is as dead as a rock… terrestrial rock or moon-stone or Martian rock… It’s dead. The paradigm simply does not fit into modern computing – in fact, IMO the teaching of BASIC should be banned because it promotes poor logic practices and awkward constructs.

starchild
Mon Jun 20, 2016 9:50 am
JohnL wrote:https://www.b4x.com/b4r.html

https://www.b4x.com/android/forum/


zoomx
Mon Jun 20, 2016 10:30 am
There exist programs and online services that translate between VB.Net and C#, they are not perfect but demonstrates that today they are interchangeable.

simonf
Mon Jun 20, 2016 12:20 pm
zoomx wrote:There exist programs and online services that translate between VB.Net and C#, they are not perfect but demonstrates that today they are interchangeable.

Pito
Mon Jun 20, 2016 12:31 pm
I think a BASIC interpreter “running on the chip” would be great to have. Similar alternatives are Forth, Espruino (javascript), Lua.
The issue is all “good old” Basics are written in asm of the respective cpu/mcus. The Basics written in C usually require a lot of RAM and are slow.
Of course there are “not good practices” related to work with a Basic – spaghetti code, goto, try-and-error way of development, etc.
Indeed I would be happy to have something like the Intel’s 8052AH Basic running on today’s mcus.. ;)
BTW, I still posses a 3.5in diskette copied in 1992 with its asm source.. :)

mrburnette
Mon Jun 20, 2016 12:54 pm
Pito wrote:<…>
The issue is all “good old” Basics are written in asm of the respective cpu/mcus. The Basics written in C usually require a lot of RAM.
<…>

Pito
Mon Jun 20, 2016 1:01 pm
This is an interesting Basic I worked with (2y back actually). Good communication with author.
https://github.com/paladin-t/my_basic
I compiled it for pic32mx, it worked, a bit ram hungry and not extremely fast. But maybe it would have been fine-tuned since then.

@Ray – Basically you are right. What I do like with this gadgets is: they are standalone systems (no IDE needed, only a serial terminal connected). The Forth standalone gadgets are nice too, but the sources are not readable (write only language :) ). So the Basic is the closest alternative when talking simple prototyping standalone embedded mcu systems without a need for any IDE..


mrburnette
Mon Jun 20, 2016 1:36 pm
I find the snobbery around the language quite perplexing. Computer Languages are like normal languages.

Really?

zoomx wrote:
There exist programs and online services that translate between VB.Net and C#, they are not perfect but demonstrates that today they are interchangeable.

I’m a MSCE (was, retired) but VB.Netreally is not BASIC. Just because Microsoft calls it BASIC does not mean that it is… the last “real’ basic Microsoft wrote was QBASIC.
MBASIC (BASIC-80) ===> GW-BASIC ===> QuickBASIC ===> QBASIC
Even QuickBASIC/QBASIC is ‘iffy’ because it broke new ground by not requiring line numbers and adding some control structures.

Visual Basic and VB.Net are like Arduino code … they are a front-facing facade. Just because Microsoft elected to call ’em BASIC does not make them so. One could sit down for a weekend fun play and rework/rename most of the Arduino commands to make it appear as BASIC… but that does not make it BASIC.

BASIC

I made a lots of money on BASIC from the mid-70’s until the mid-90’s. One can do great things in BASIC, but one can screw up just as bad in BASIC as they can in C++. But BASIC is simply not the right 1st language for anyone. It is OK to play around with on old PC’s, Apple II, etc. But other than to load an old game tape from the cassette recorder, it is not a language that is moving forward. Whatever Microsoft has produced with VB.Net is not BASIC.

HTML5, Javascript, C++, and a long, long list of other event driven paradigms are the future of languages. Accept it. LUA (I do not use) is suppose to be a nice interpreter and Nick Gammon is very big on this language.

Ray


simonf
Mon Jun 20, 2016 6:15 pm
mrburnette wrote:I find the snobbery around the language quite perplexing. Computer Languages are like normal languages.

Really?


simonf
Mon Jun 20, 2016 7:21 pm
For those of you who haven’t looked at “BASIC For Arduino” and all the other B4x they are not interpreters.

The B4R IDE converts a Structured BASIC program and converts it to C++ before compiling it using the arduino. They have similar products for IOS and Android. This means using one language you can write programs for PI, Arduino , iphone Android etc.

There is no real reason that code written in B4R should be much bigger than native android code, other than things like strings which may not convert into the same TYPES.

The IDE has intelisence and leaves the arduino IDE for dead. When it converts the source to C it annotates the c with the basic source for basic debugging. By default it uses the upload serial port as a logger for debugging which is what most beginners seem to do to figure out what there code is doing inside the MCU.

Example B4r

Sub Process_Globals
Public Serial1 As Serial
Private Timer1 As Timer
Private pin13 As Pin

End Sub

Private Sub AppStart
Serial1.Initialize(115200)
Log("AppStart")
pin13.Initialize(13, pin13.MODE_OUTPUT)
Timer1.Initialize("Timer1_Tick", 1000) '1000ms = 1 second
Timer1.Enabled = True

End Sub

Private Sub Timer1_Tick
Dim currentState As Boolean = pin13.DigitalRead
Log("CurrentState: ", currentState)
Dim NewState As Boolean = Not(currentState)
Log("NewState: ", NewState)
pin13.DigitalWrite(NewState)

End Sub


mrburnette
Mon Jun 20, 2016 8:31 pm
simonf wrote:
<…>
The B4R IDE converts a Structured BASIC program and converts it to C++ before compiling it using the arduino.

simonf
Mon Jun 20, 2016 9:08 pm
mrburnette wrote:

My opinion, if you are going to work in some pseudo language that spits out C++, just learn C++. For goodness sakes: do not learn C++ from studying what a translator spits out!

Ray


Leave a Reply

Your email address will not be published. Required fields are marked *