==== USBSTATUS ====
----
----
Get status of the USB driver
----
^ __Input Stack__ ^ ^ __Output Stack__ ^
| | **→** | **#status** |
| //Level 1// | //→// | //Level 1// |
{{page>manual:chapter6:aux:legend&nofooter&noeditbtn&inline}}
|**Type**| [[manual:chapter5:basics#commands|Command]] ||
|**Parallel list processing**| [[manual:chapter5:listproc#group-1commands-that-cannot-parallel-process|Group 1]] ||
|**Affected by flags**| None ||
----
The ''USBSTATUS'' command returns the current status of the USB driver. Information is encoded in a byte as follows:
^ Bit ^ Value ^ Meaning ^
| **0** | Clear | USB cable is connected. |
| ::: | Set | USB cable is disconnected. |
| **1** | Clear | USB driver has not completed its configuration. |
| ::: | Set | USB driver has completed its configuration. |
| **2** | Clear | USB data is not incoming. |
| ::: | Set | USB data is incoming. |
----
This command is new in newRPL and does not exist in userRPL.
----
The following program
« DO
UNTIL
USBSTATUS #3h ==
END
"OK"
»
will result in the calculator waiting in a loop for a connection to the PC to be estabilished and
1: "OK"
……………………………………………………………………………………
once the connection is done.
----
{{page>manual:chapter6:usb&nofooter&noeditbtn&inline}}