General area when it fits no where else

Moderator: Mmiscool

User avatar
By MegaHurtz
#81168 Good day. New to ESPs as a whole. Am working embedded dev on some ARM devices, using a BASIC dialect known as ARMbasic (https://www.coridium.us/coridium/). Wanted to add IP and Web Connectivity to my devices (working with 54005 & 54102 uC from NXP currently). Given I am dev'g in ARMbasic, I searched around the interwebz to find what firmware options exist, for the various ESP devices I've settled on (ESP8266 for non-BT/non-BLE stuffs, and ESP-WROOM-32s for those projects that have BT/BLE connectivity requirements), and stumbled upon ESP BASIC. Pretty darned convenient, as I am not a C/C++/OOP guy. Was initially concerned about the maturity, but I see that Mike and the community have invested a lot of effort to get a pretty robust product instantiated in a relatively short period of time. Kudos.!.

Anyways, on to my observations/questions:

  • I see there are branch labels that I perceive are synonymous with sub routines/labels from other BASIC dialects. Are there constructs that a dev can use to implement user functions with - i.e. code blocks that receive passed parameters and return a value (or a pointer to a structure of values)? I understand that globals can be leveraged to return values from a branch label code block. This is more for my situational awareness.
  • Does the concept of variable scope exist in ESP BASIC? Again, for my situational awareness.
  • I noted the operator table in the docs package. I note the use of $ in string var names is supported but not required (if using the 'as string' hint when a string var w/o a $ is DIM'd).
  • Do string functions terminate when a null byte (0x00) is encountered?
  • I note the stack depth of 255 for nesting code execution. Are the length of strings or arrays limited?
  • Does ESP BASIC's expression parser/syntax support non-base 10 numbers - i.e. Hex representations?
  • If so, are same denoted with 0x or &H prefixes?
  • Given the interpreted nature of ESP BASIC, I understand this lends a lot of latitude for what is done under the hood vs. what is exposed to those dev'g with ESP BASIC. Is it a correct presumption that there is a distinction between integers and floats in variables, or is everything handled internally as a string and the firmware/runtime deal with those dynamics on a function by function basis?
  • Does ESP BASIC employ the use of 32-bit IEEE-754 floats, or is a higher precision float lib being used.
Lastly, as enumerated, I am looking at using a ESP-01 type of device as a piece of middle-ware between the world and my embedded device. I had not considered a context of running proper applications on the ESP device but, as I continue to become more familiar with them I can see a value in off-loading some of that stuff to the ESP, and not burden the host micro with all the drama that the ESPs serve to help manage and mitigate. This leads me to two final questions:

  • I note that on the serial port of the ESP-01, when the ESP BASIC interpreter is running, that I observe some traffic from the interpreter (as it might be a bit chatty?). Does the interpreter provide a means to squelch those debug/error emissions and have a user BASIC app have full control over the serial transmissions and receive all serial input from an external device connected thereto?
  • Given my intended use of the ESP devices in this context, objectively, is ESP BASIC a viable candidate for the firmware on a device that is going to act in the capacity of a comms transport provider, and possibly as a web UI front-end (if it can serve UI Pages that I interpret it can from the docs)?

EDIT (another question): Is support for ESP BASIC on the ESP-32 family of devices planned?

Please advise. Thank you, in advance!

-MHz