This is what I think I am doing. This is the Arduino code:
#include <DigiCDC.h>
void setup() {
// initialize the digital pin as an output.
SerialUSB.begin();
pinMode(1,OUTPUT);
}
// the loop routine runs over and over again forever:
void loop() {
if (SerialUSB.available()) {
char input = SerialUSB.read();
if(input == '0')
digitalWrite(1,LOW);
else if(input == '1')
digitalWrite(1,HIGH);
}
SerialUSB.delay(100); // keep usb alive // can alos use SerialUSB.refresh();
}
And the ATTINY85 can be detected in Windows, also in Android, but using the serial USB terminal app from Google Play.
Using the SerialOTG in my app I can detect other device connected to the same Android ( com.physicaloid_ai.lib.usb.driver.uart.UartWinCH34x), but not my ATTINY85, even if it is the only connected device.
Interesting application with USB support on this small board. I have added support for ATTINY85 VID 0x16D0 9 in com.SerialOTG. I also updated my test program SerialOTG.apk. You can download them at https://github.com/rkl099/Appinventor_Debug. I have tested the led application on a ATTINY85 that I had and it seems to work. it has a different PID, but it's not used in the library. Please test and tell me if it works OK.
I have not tested this Arduino board. SerialOTG only supports Bluetooth classic (ver 3.0) and the Arduino seems to only support Ble. I don’t know if there is an Arduino library for Bt classic.
Serial over USB OTG (VID 2341) should work, but not tested.
Hi, i have Android 12S (Galaxy21FE5G). The extension gives still an error: "Runtime Error Attempt to invoke virtual method 'boolean com.physicaloid_ai.lib.framework.SerialCommunicator.open()' on a null object reference"
Maybe this helps Johannes
It works! My device is an Arduino micro (ATmega32U4). But works only with connected device and at 2nd try. Without the device i got the error like my first answer. In older versions i got no error message without device.
Thanks Rolf @rkl099 .
You made me pull file again - different size, loads fine.
p.s. : one should pull file (git or download as zip) NOT try dowloading single file
Thanks again @rkl099 for fixing intent. Now I have same problem as @Johannes_Fritzsche described (here Samsung S21).
When Open method is invoked on unconnected usb cable it throws error (can't catch by Screen.ErrorOccured). Previously Open just returned 0.
I can't find a check method to invoke before Open so to avoid this problem but IMHO I liked better just returning 0 by Open.
Once I know this I will check if it survives disconnecting usb/serial cable...
Best regards and thanks for a great component Rolf and sorry for bothering you!
Kuba
The original Physicaloid library checked the VID/PID in two programs. I made a change to have a single table define VID/PID and driver. This was an undetected side effect and will be corrected in the future.
It will be easier to include new PID/VID:s and if possible, include a function for user defined VID/PID/driver definition.
No workaround but I have updated the extension to report "not open" if no USB device connected. The selection of driver is now in a single table, depending on VID or VID/PID. Tested with the USB devices I have. Please try it and report to me.