convert java library to b4a library

DonManfred

Expert
Licensed User
I do not have any Arduino Board(s). But basically the library does not look complicated.

I can build you an example which you need to test. It may crash and you need to report back as i can not test it here. ;-)

Probably some of the methods needs to be rewritten to be async. You need to test for sure too ;-)

What is your budget for this?
 
Last edited:

DonManfred

Expert
Licensed User
and it should work for the ch340 serial chip
Does the lib has support for this Chip? I can not see it in the ENUM list
B4X:
public enum Boards {
    // Arduino Series
    ARDUINO_UNO                 (1, "auno",ChipTypes.M328P,     UploadProtocols.STK500,  115200, ComProtocols.UART, "Arduino Uno"),
    ARDUINO_DUEMILANOVE_328     (1, "duem",ChipTypes.M328P,     UploadProtocols.STK500,   57600, ComProtocols.UART, "Arduino Duemilanove ATmega328"),
    ARDUINO_DUEMILANOVE_168     (1, "diec",ChipTypes.M168,      UploadProtocols.STK500,   19200, ComProtocols.UART, "Arduino Diecimila or Duemilanove ATmega168"),
    ARDUINO_NANO_328            (0, "na32",ChipTypes.M328P,     UploadProtocols.STK500,   57600, ComProtocols.UART, "Arduino Nano ATmega328"),
    ARDUINO_NANO_168            (0, "na16",ChipTypes.M168,      UploadProtocols.STK500,   57600, ComProtocols.UART, "Arduino Nano ATmega168"),
    ARDUINO_MEGA_2560_ADK       (1, "mg25",ChipTypes.M2560,     UploadProtocols.STK500V2,115200, ComProtocols.UART, "Arduino Mega 2560 or ADK"),
    ARDUINO_MEGA_1280           (0, "mg16",ChipTypes.M1280,     UploadProtocols.STK500,   57600, ComProtocols.UART, "Arduino Mega (ATmega1280)"),
//    ARDUINO_LEONARD             (0, "leon",ChipTypes.ATMEGA32U4,UploadProtocols.AVR109,   57600, ComProtocols.UART, "Arduino Leonardo"),
//    ARDUINO_ESPLORA             (0, "espl",ChipTypes.ATMEGA32U4,UploadProtocols.AVR109,   57600, ComProtocols.UART, "Arduino Esplora"),
//    ARDUINO_MICRO               (0, "micr",ChipTypes.ATMEGA32U4,UploadProtocols.AVR109,   57600, ComProtocols.UART, "Arduino Micro"),
    ARDUINO_MINI_328            (0, "mn32",ChipTypes.M328P,     UploadProtocols.STK500,   57600, ComProtocols.UART, "Arduino Mini ATmega328"),
    ARDUINO_MINI_168            (0, "mn16",ChipTypes.M168,      UploadProtocols.STK500,   57600, ComProtocols.UART, "Arduino Mini ATmega168"),
    ARDUINO_ETHERNET            (0, "ethe",ChipTypes.M328P,     UploadProtocols.STK500,  115200, ComProtocols.UART, "Arduino Ethernet"),
    ARDUINO_FIO                 (0, "afio",ChipTypes.M328P,     UploadProtocols.STK500,   57600, ComProtocols.UART, "Arduino Fio"),
    ARDUINO_BT_328              (0, "bt32",ChipTypes.M328P,     UploadProtocols.STK500,   19200, ComProtocols.UART, "Arduino BT ATmega328"),
    ARDUINO_BT_168              (0, "bt16",ChipTypes.M168,      UploadProtocols.STK500,   19200, ComProtocols.UART, "Arduino BT ATmega168"),
//    ARDUINO_LILYPAD_USB         (0, "lpus",ChipTypes.ATMEGA32U4,UploadProtocols.AVR109,   57600, ComProtocols.UART, "LilyPad Arduino USB"),
    ARDUINO_LILYPAD_328         (0, "lp32",ChipTypes.M328P,     UploadProtocols.STK500,   57600, ComProtocols.UART, "LilyPad Arduino ATmega328"),
    ARDUINO_LILYPAD_168         (0, "lp16",ChipTypes.M168,      UploadProtocols.STK500,   19200, ComProtocols.UART, "LilyPad Arduino ATmega168"),
    ARDUINO_PRO_5V_328          (1, "pm53",ChipTypes.M328P,     UploadProtocols.STK500,   57600, ComProtocols.UART, "Arduino Pro or Pro Mini (5V, 16MHz) ATmega328"),
    ARDUINO_PRO_5V_168          (1, "pm51",ChipTypes.M168,      UploadProtocols.STK500,   19200, ComProtocols.UART, "Arduino Pro or Pro Mini (5V, 16MHz) ATmega168"),
    ARDUINO_PRO_33V_328         (1, "pm33",ChipTypes.M328P,     UploadProtocols.STK500,   57600, ComProtocols.UART, "Arduino Pro or Pro Mini (3.3V, 8MHz) ATmega328"),
    ARDUINO_PRO_33V_168         (1, "pm31",ChipTypes.M168,      UploadProtocols.STK500,   19200, ComProtocols.UART, "Arduino Pro or Pro Mini (3.3V, 8MHz) ATmega168"),
    ARDUINO_NG_168              (0, "ng16",ChipTypes.M168,      UploadProtocols.STK500,   19200, ComProtocols.UART, "Arduino NG or older ATmega168"),
    ARDUINO_NG_8                (0, "ng08",ChipTypes.M8,        UploadProtocols.STK500,   19200, ComProtocols.UART, "Arduino NG or older ATmega8"),

    BALANDUINO                  (1, "bala",ChipTypes.M1284P,    UploadProtocols.STK500,  115200, ComProtocols.UART, "Balanduino"),
    POCKETDUINO                 (1, "podu",ChipTypes.M328P,     UploadProtocols.STK500,   57600, ComProtocols.UART, "PocketDuino"),

    // mbed Series
//    MBED_LPC1768                (0, "mbd1",ChipTypes.MBED_LPC1768,      UploadProtocols.USBMEM,   0, ComProtocols.UART, "mbed LPC1768"),
//    MBED_LPC11U24               (0, "mbd2",ChipTypes.MBED_LPC11U24,     UploadProtocols.USBMEM,   0, ComProtocols.UART, "mbed LPC11U24"),
//    MBED_FRDM_KL25Z             (0, "mbd3",ChipTypes.MBED_FRDM_KL25Z,   UploadProtocols.USBMEM,   0, ComProtocols.UART, "mbed FRDM-KL25Z"),

    // FPGA Series
    PERIDOT                     (1, "fp01",ChipTypes.PHYSICALOID_CYCLONE,  UploadProtocols.ALTERA_FPGA_RBF, 0, ComProtocols.USYNC_FIFO, "Physicaloid FPGA PERIDOT Board"),

    NONE                        (0, "",0,0,0,0,"");
 
Top