Probot Blocks is a block-based coding tool compatible with probot-lib. This tool allows you to easily program your robotics projects using visual blocks and generates C++ code that can be used in Arduino IDE.
- Visual Block Editor: Google Blockly-based drag-and-drop interface
- Probot-lib Compatibility: Full integration with NFR Probot library
- Live Code Preview: Real-time C++ code display while editing blocks
- Project Management: Save/load block projects (.probot.json format)
- Arduino IDE Compatibility: Direct .ino file download
- Turkish Interface: Complete Turkish user experience
- Driver Station Integration: Automatic password generation and management
- Responsive Design: Optimal usage on desktop and tablet devices
- React 19 + TypeScript - Modern frontend development
- Vite - Fast development and build system
- Google Blockly - Visual programming editor
- Highlight.js - Code syntax highlighting
- probot-lib - NFR Robotics library support
- Node.js 18+
- npm or yarn
# Clone the repository
git clone https://github.com/your-username/probot-blocks.git
cd probot-blocks
# Install dependencies
npm install
# Start development server
npm run devThe application will run at http://localhost:5173.
# Create build
npm run build
# Preview build
npm run preview- Block Selection: Choose blocks from the category menu on the left
- Block Placement: Drag and drop blocks into the workspace
- Code Preview: View the generated C++ code in the right panel
- Project Saving: Save your project with the "Download Blocks" button
- Arduino IDE Transfer: Download Arduino sketch with ".ino Download" button
- Control: Loops, conditions, flow control
- Logic: Boolean operations, comparisons
- Math: Arithmetic operations, math functions
- Text: String operations and manipulation
- Lists: Array operations
- Variables: Variable definition and usage
- Arduino: Basic Arduino functions (digitalWrite, delay, Serial.print)
- Probot: NFR Probot-lib special blocks (motor control, sensors)
Probot framework lifecycle functions:
robotInit: Runs once when the robot startsrobotEnd: Called when the robot shuts downautonomousInit: Runs before autonomous mode startsautonomousPeriodic: Runs continuously in autonomous modeteleopInit: Runs before teleop mode startsteleopPeriodic: Runs continuously in teleop mode
probot-blocks/
βββ src/
β βββ blockly/ # Blockly configuration
β β βββ blocks.ts # Custom block definitions
β β βββ generator.ts # C++ code generator
β βββ App.tsx # Main application component
β βββ App.css # Style file
β βββ main.tsx # Application entry point
βββ public/ # Static files
βββ dist/ # Build output
βββ package.json # Project configuration
To add new blocks, edit the src/blockly/blocks.ts file:
// New block definition
const myCustomBlock = {
type: 'my_custom_block',
message0: 'Custom Block %1',
args0: [
{
type: 'input_value',
name: 'INPUT'
}
],
colour: 160,
tooltip: 'This is my custom block',
helpUrl: ''
}Add the code generator for the new block in src/blockly/generator.ts:
javascriptGenerator.forBlock['my_custom_block'] = function(block, generator) {
const input = generator.valueToCode(block, 'INPUT', Order.NONE) || '""'
return `myCustomFunction(${input});\n`
}# ESLint check
npm run lint
# TypeScript type check
npm run type-check// Block: probot_nfr_motor
// Generated code:
nfr.forward(100); // Move forward
nfr.backward(50); // Move backward
nfr.turnRight(75); // Turn right
nfr.turnLeft(75); // Turn left
nfr.stop(); // StopThe application automatically generates a Driver Station password and includes it in the project. Password format: PB-XXX-XXX (e.g., PB-A2F-9K3)
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'feat: add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Create a Pull Request
This project uses Conventional Commits standard:
feat:- New featurefix:- Bug fixdocs:- Documentation changesstyle:- Code formatting changesrefactor:- Code refactoringtest:- Adding/updating testschore:- Build system, dependency updates
This project has dual licensing:
- Open Source Usage: MIT License - see
LICENSEfile - Commercial Usage: Commercial license required - see
LICENSE-commercialfile
For detailed information, contact NFR Robotics.
NFR Robotics is Turkey's leading robotics education and technology development company. Probot Blocks is an open-source project developed for educational institutions and robotics enthusiasts.
Contact:
- Web: nfr.com.tr
- Email: info@nfr.com.tr
- Google Blockly - Visual programming editor
- React - UI framework
- Vite - Build tool
- Highlight.js - Syntax highlighting
Probot Blocks - Bring your robotics projects to life easily! ππ€