BriCode
Code environment for Brian - the brain brick
Features
- Wi-Fi Upload & Run: Upload Python files directly to Brian over Wi-Fi and execute them remotely.
- Multiple Upload Methods: Choose between Wi-Fi upload with run, Wi-Fi upload only, or USB cable copy.
- Device Discovery: Automatically scan your network to find available Brian devices.
- Console Streaming: View real-time program output and send interactive input from VS Code.
- Integrated Debugging: Use F5 to upload and run files with full launch.json configuration support.
- Copy Current File to Brian: Instantly copy the file you are working on to your selected Brian folder with one click.
- Status Bar Button: Quick access to copy the current file from the VS Code status bar.
- Install Brian typing (autocompletion): Download and install Brian typings into a chosen folder/workspace for IntelliSense support.
Usage
Wi-Fi Upload (Recommended)
Set up Brian's IP address:
- Use
BriCode: Discover Brian Devices to automatically find Brian on your network
- You can also use the
Connect to Brian (Wi-Fi) button
Upload and run your code:
- Open a Python file (
.py)
- Press F5 or use the Run button
- Choose your upload method:
- Upload and Run (Wi-Fi) - Uploads and executes immediately with console streaming
- Upload (Wi-Fi) - Uploads without running
- Upload via Cable - Copies to Brian's USB storage
View output:
- Console output streams automatically to the BriCode output channel
- Send input to running programs with
BriCode: Send Console Input
USB/Local Folder Copy
- Open a file in VS Code.
- Use the status bar button or BriCode Control Panel to copy it to Brian.
- Select a Brian folder if prompted.
- Change the folder anytime via the Control Panel or command.
Commands
Wi-Fi Commands
BriCode: Discover Brian Devices (bricode.discoverBrianDevices) - Scan network for Brian devices
BriCode: Set Brian IP Address (bricode.setBrianIp) - Manually configure Brian's IP address
BriCode: Upload Current File (bricode.uploadFile) - Upload file to Brian via Wi-Fi
BriCode: Upload and Run Current File (bricode.uploadAndRunFile) - Upload and execute file via Wi-Fi
BriCode: Send Console Input (bricode.sendConsoleInput) - Send input to running program
Local/USB Commands
BriCode: Copy Current File to Brian (bricode.copyCurrentFileToBrian) - Copy file to local Brian folder
BriCode: Select Brian Folder (bricode.selectBrianFolder) - Choose target folder for copying
BriCode: Install Brian typing (autocompletion) (bricode.downloadBrianTyping) - Install typing stubs for IntelliSense
BriCode: Toggle Debug Mode (bricode.toggleDebugMode) - Enable verbose logging
Configuration
Debug Configurations
When you press F5 on a Python file without a launch.json, BriCode will offer to create one with these configurations:
- BriCode: Upload and Run (Wi-Fi) - Upload via Wi-Fi and run with console streaming
- BriCode: Upload (Wi-Fi) - Upload only, don't execute
- BriCode: Upload via Cable - Copy to Brian USB storage
Each configuration uses ${file} to run the currently active file, but you can customize this to specific files.
Troubleshooting
Wi-Fi Upload Issues
- Ensure Brian is connected to the same network as your computer
- Verify Brian's IP address with
BriCode: Discover Brian Devices
- Try toggling debug mode (
BriCode: Toggle Debug Mode) for verbose logging
Console Not Streaming
- Ensure "Upload and Run" was selected (not just "Upload")
- Check the BriCode output channel (View → Output → Select "BriCode")
- Verify the program is actually running on Brian
| |