Time for a new release?

Started by round157, March 07, 2025, 18:06:43

Previous topic - Next topic

round157

https://www.syntaxbomb.com/smallbasic/time-for-a-new-release!!/

Hi....one year again. Will there be a new version be released in the near future? 

chrisws

I'm working on wrapping up the android update. This will have the updated audio handling, J7Ms new icon plus a new API for USB Serial handling.
It will be on the test channel for a week or so, then I'll switch it to the release channel unless someone finds something. 

round157

Quote from: chrisws on March 15, 2025, 23:24:26I'm working on wrapping up the android update. This will have the updated audio handling, J7Ms new icon plus a new API for USB Serial handling.
It will be on the test channel for a week or so, then I'll switch it to the release channel unless someone finds something.
Wow...thanks a lot. 

round157

A small suggestion... 

I wanted to download the HTML version of the language reference here but only the TXT version was available. Including the HTML version of the language reference in version 12.28 of SmallBASIC will be convenient for users. 

https://smallbasic.github.io/reference/sbref.txt



Tinine

Quote from: chrisws on March 15, 2025, 23:24:26I'm working on wrapping up the android update. This will have the updated audio handling, J7Ms new icon plus a new API for USB Serial handling.
It will be on the test channel for a week or so, then I'll switch it to the release channel unless someone finds something.
Oh I'm excited again  :D

I don't suppose this has BlueTooth comm's?

In RFO BASIC, for example, we have BT.OPEN, BT.CONNECT, BT.STATUS, BT.READ, BT.WRITE, etc., etc.



chrisws

Quote from: Tinine on March 18, 2025, 14:36:34
Quote from: chrisws on March 15, 2025, 23:24:26I'm working on wrapping up the android update. This will have the updated audio handling, J7Ms new icon plus a new API for USB Serial handling.
It will be on the test channel for a week or so, then I'll switch it to the release channel unless someone finds something.
Oh I'm excited again  :D

I don't suppose this has BlueTooth comm's?

In RFO BASIC, for example, we have BT.OPEN, BT.CONNECT, BT.STATUS, BT.READ, BT.WRITE, etc., etc.



I made the usb api to be compatible with teensy 4.0 but it should also work with arduino. Here some example code

import android
usb = android.openUsbSerial(0x16C0)
while 1
  input k
  n = usb.send(k);
  print "sent "; n
  print usb.receive()
wend

It looks like I could also add BT support in a similar way - BT classic, not BLE.

Tinine

Quote from: chrisws on March 18, 2025, 21:08:36
Quote from: Tinine on March 18, 2025, 14:36:34
Quote from: chrisws on March 15, 2025, 23:24:26I'm working on wrapping up the android update. This will have the updated audio handling, J7Ms new icon plus a new API for USB Serial handling.
It will be on the test channel for a week or so, then I'll switch it to the release channel unless someone finds something.
Oh I'm excited again  :D

I don't suppose this has BlueTooth comm's?

In RFO BASIC, for example, we have BT.OPEN, BT.CONNECT, BT.STATUS, BT.READ, BT.WRITE, etc., etc.



I made the usb api to be compatible with teensy 4.0 but it should also work with arduino. Here some example code

import android
usb = android.openUsbSerial(0x16C0)
while 1
  input k
  n = usb.send(k);
  print "sent "; n
  print usb.receive()
wend

It looks like I could also add BT support in a similar way - BT classic, not BLE.

Awesome  8) BT Classic is preferred, actually. Not had great experience with BLE.

round157


J7M

#8
I tested the USB serial connection with an Arduino Uno. Here are the programs:

Code: BASIC
// Upload to Arduino using Arduino IDE

int inByte = 0;        // incoming serial byte

void setup() {
  Serial.begin(19200);
  while (!Serial) {
    ;  // wait for serial port to connect.
  }
  pinMode(LED_BUILTIN, OUTPUT);
  digitalWrite(LED_BUILTIN, 1);
  delay(100);
  digitalWrite(LED_BUILTIN, 0);
  delay(100);
}

void loop() {
  if (Serial.available() > 0)
  {
    inByte = Serial.read();
    Serial.write(inByte);
    if(inByte == '0')
      digitalWrite(LED_BUILTIN, 0);
    else
      digitalWrite(LED_BUILTIN, 1);  
  }
}


Code: BASIC
' SmallBASIC code running on Android

import android
usb = android.openUsbSerial(0x2A03)    ' Vendor ID of Arduino Uno

while 1
  input k
  n = usb.send(str(k))
  delay(100)
  print usb.receive()
wend

I can connect to the Arduino and toggle the builtin LED by sending 1 or 0. That is really nice  Receiving data is not easy. A function telling me, that data is waiting is missing. Something like "usb.available()" which returns the available bytes is necessary. It would be also helpful, if it is possible to send a byte. Maybe two different sending function like "usb.sendString(s)" and "usb.sendByte(n)" would be great. At the moment speed is hard coded at 19200 baud. Would be great if the user can set it. Thank you Chris. Great work.

Tinine

Looking  8) :D

I highly recommend the PicoMite (RPi Pico) MCU though. Self hosted interpreter but with an assembler for the PIO. Achieving great things with these devices.

chrisws

Quote from: J7M on March 26, 2025, 11:58:34I tested the USB serial connection with an Arduino Uno. Here are the programs:

Code: BASIC
// Upload to Arduino using Arduino IDE

int inByte = 0;        // incoming serial byte

void setup() {
  Serial.begin(19200);
  while (!Serial) {
    ;  // wait for serial port to connect.
  }
  pinMode(LED_BUILTIN, OUTPUT);
  digitalWrite(LED_BUILTIN, 1);
  delay(100);
  digitalWrite(LED_BUILTIN, 0);
  delay(100);
}

void loop() {
  if (Serial.available() > 0)
  {
    inByte = Serial.read();
    Serial.write(inByte);
    if(inByte == '0')
      digitalWrite(LED_BUILTIN, 0);
    else
      digitalWrite(LED_BUILTIN, 1);  
  }
}


Code: BASIC
' SmallBASIC code running on Android

import android
usb = android.openUsbSerial(0x2A03)    ' Vendor ID of Arduino Uno

while 1
  input k
  n = usb.send(str(k))
  delay(100)
  print usb.receive()
wend

I can connect to the Arduino and toggle the builtin LED by sending 1 or 0. That is really nice  Receiving data is not easy. A function telling me, that data is waiting is missing. Something like "usb.available()" which returns the available bytes is necessary. It would be also helpful, if it is possible to send a byte. Maybe two different sending function like "usb.sendString(s)" and "usb.sendByte(n)" would be great. At the moment speed is hard coded at 19200 baud. Would be great if the user can set it. Thank you Chris. Great work.

That's cool that it worked on the uno!

I could change send() to take other internal datatypes, this would allow you to pass an int etc using the same interface.

Also adding a speed option is also possible.

What is a bit trickier is implementing an available() function. The code is based on this which doesn't appear to support testing data availability, just attempting to read.

https://developer.android.com/reference/android/hardware/usb/UsbDeviceConnection

You could have something like this to implement an available check in SB code.

d = usb.receive()
if (len(d)> 0) then ...

The RPi Pico is very cheap! Just about to order a Pico 2W


J7M

Quoted = usb.receive()
if (len(d)> 0) then ...
that would work, if you set the timeout to 1ms. Then the usb.receive() command could be placed in a loop. The 1ms is short enough that the user has the feeling, that receive() does not block execution of the program.

QuoteI could change send() to take other internal datatypes, this would allow you to pass an int etc using the same interface.
Would be fine for me.