We welcome contributions to AutoThrottleNG! This document provides guidelines and information for contributors.
- Code of Conduct
- Getting Started
- Types of Contributions
- Development Process
- Code Standards
- Testing Requirements
- Documentation
- Pull Request Process
- Issue Reporting
- Community
This project follows a code of conduct to ensure a welcoming environment for all contributors. By participating, you agree to:
- Be respectful and inclusive
- Focus on constructive feedback
- Accept responsibility for mistakes
- Show empathy towards other contributors
- Help create a positive community
Before contributing, ensure you have:
- Arduino IDE 1.8.0+ or PlatformIO
- Arduino PID Library (automatically installed via
make install-deps) - Git for version control
- Arduino board for testing (Uno, Mega, ESP32, etc.)
-
Clone the repository:
git clone https://github.com/yourusername/AutoThrottleNG.git cd AutoThrottleNG -
Install dependencies:
make install-deps
-
Verify setup:
make test-all
-
Run examples:
make compile-examples
- Bug fixes - Critical for library stability
- New features - Enhancements and new capabilities
- Performance improvements - Optimization and efficiency
- Compatibility fixes - Support for new boards/platforms
- README updates - Keep installation and usage current
- API documentation - Document new methods and features
- Examples - Create practical usage examples
- Troubleshooting guides - Help users resolve issues
- Unit tests - Test individual components
- Integration tests - Test combined functionality
- Compatibility testing - Verify across different platforms
- Example validation - Ensure examples compile and work
- Issue triage - Help categorize and prioritize issues
- Community support - Answer questions in issues/discussions
- Code review - Review pull requests from other contributors
- Check GitHub Issues for open tasks
- Look for issues labeled
good first issueorhelp wanted - Comment on the issue to indicate you're working on it
# Create and switch to a feature branch
git checkout -b feature/your-feature-name
# Or for bug fixes
git checkout -b fix/issue-number-description- Follow the code standards below
- Test your changes thoroughly
- Update documentation as needed
- Add examples for new features
# Run all tests
make test-all
# Test specific examples
make compile-basic
make compile-motor
# ... etc
# Upload to Arduino for real testing
make upload-basic PORT=/dev/ttyACM0# Stage your changes
git add .
# Commit with descriptive message
git commit -m "Add feature: brief description of changes
- Detailed explanation of what was changed
- Why the change was needed
- Any breaking changes or special considerations"- Push your branch to GitHub
- Create a pull request with a clear description
- Reference any related issues
- Request review from maintainers
-
Naming Conventions:
- Classes:
PascalCase(e.g.,AutoThrottleNG) - Methods:
camelCase(e.g.,setTarget()) - Variables:
camelCase(e.g.,pidInput) - Constants:
UPPER_CASE(e.g.,MAX_OUTPUT) - Private members:
_underscorePrefix(e.g.,_pidInput)
- Classes:
-
Formatting:
- Use 4 spaces for indentation (or match existing code)
- Line length: 100 characters maximum
- Consistent brace placement
- Space around operators
-
Documentation:
- Use Doxygen-style comments for public methods
- Document parameters and return values
- Explain complex algorithms
- Include usage examples where helpful
/**
* @brief Sets the target setpoint for the controller
* @param target The desired setpoint value
*/
void setTarget(double target) {
if (isnan(target) || isinf(target)) {
return; // Reject invalid inputs
}
_pidSetpoint = target;
}- Memory Management: Be mindful of limited RAM on AVR boards
- PROGMEM: Use
F()macro for string literals in Serial prints - Volatile Variables: Use
volatilefor interrupt-shared variables - Timing: Use
millis()instead ofdelay()for non-blocking code
All contributions must pass compilation tests:
# Test all examples compile
make compile-examples
# Test specific functionality
make compile-basic # Basic PID
make compile-advanced # Failsafe features
make compile-operational # Operational modes- Manual Testing: Upload examples to Arduino board and verify operation
- Edge Cases: Test with extreme values, error conditions
- Mode Testing: Verify all operational modes work correctly
- Recovery Testing: Test auto-recovery functionality
Test on multiple platforms when possible:
- AVR: Arduino Uno, Mega, Leonardo
- ARM: Arduino Due, Zero
- ESP32: ESP32-based boards
- SAMD: MKR series boards
- Memory Usage: Monitor RAM and flash usage
- Execution Time: Verify real-time performance
- Resource Limits: Ensure operation within Arduino constraints
- README Updates: Update main README for new features
- API Documentation: Document all public methods
- Examples: Create examples for new features
- Inline Comments: Explain complex logic
- Clear Language: Use simple, technical English
- Complete Information: Include all necessary details
- Practical Examples: Provide working code examples
- Cross-References: Link related documentation sections
- Self-Review: Check your code meets all standards
- Testing: Ensure all tests pass
- Documentation: Update docs for any changes
- Compatibility: Test on target platforms
Use this template for pull requests:
## Description
Brief description of the changes made
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Documentation update
- [ ] Performance improvement
- [ ] Code refactoring
## Testing
- [ ] All examples compile
- [ ] Manual testing performed
- [ ] Edge cases tested
- [ ] Documentation updated
## Breaking Changes
- [ ] No breaking changes
- [ ] Breaking changes detailed below:
- Change 1
- Change 2
## Additional Notes
Any additional information or context- Automated Checks: CI/CD runs compilation tests
- Code Review: Maintainers review code quality and standards
- Testing: Contributors may be asked to test specific scenarios
- Approval: PR approved and merged, or feedback provided for revisions
When reporting bugs, include:
- Clear Title: Descriptive but concise
- Environment: Arduino board, IDE version, library version
- Steps to Reproduce: Detailed reproduction steps
- Expected Behavior: What should happen
- Actual Behavior: What actually happens
- Code Sample: Minimal code to reproduce the issue
- Serial Output: Any relevant debug output
For new features, include:
- Use Case: Why is this feature needed?
- Implementation Idea: How should it work?
- Alternatives: Other solutions considered
- Impact: How it affects existing functionality
For improvements, include:
- Current Limitation: What's the current problem?
- Proposed Solution: How to improve it
- Benefits: What advantages does it provide?
- Compatibility: Impact on existing code
- GitHub Issues: Bug reports and feature requests
- GitHub Discussions: General questions and community support
- Pull Request Comments: Code review discussions
- Documentation First: Check docs/ folder for detailed guides
- Examples: Run provided examples to understand usage
- Search Issues: Look for similar reported issues
- Create Issue: If no existing solution found
Contributors are recognized through:
- GitHub Contributors List: Automatic recognition
- Changelog Entries: Major contributions documented
- Issue/PR References: Links in release notes
We appreciate all contributions, from bug fixes to documentation improvements. Contributors may be acknowledged in:
- README Contributors Section
- Changelog Entries
- GitHub Release Notes
- Project Documentation
Thank you for contributing to AutoThrottleNG! Your efforts help make this library better for the entire Arduino community.