fix: update README for English localization and clarity
This commit is contained in:
parent
8b1a402caf
commit
5490ad42c8
230
README.md
230
README.md
|
|
@ -1,86 +1,86 @@
|
||||||
# Arduino Emulator - Wokwi Clone
|
# Arduino Emulator - Wokwi Clone
|
||||||
|
|
||||||
Emulador local de Arduino con editor de código y simulador visual.
|
Local Arduino emulator with code editor and visual simulator.
|
||||||
|
|
||||||
## Características
|
## Features
|
||||||
|
|
||||||
- ✅ Editor de código con syntax highlighting (Monaco Editor)
|
- ✅ Code editor with syntax highlighting (Monaco Editor)
|
||||||
- ✅ Compilación de código Arduino con arduino-cli
|
- ✅ Arduino code compilation with arduino-cli
|
||||||
- ✅ **Repositorios oficiales de Wokwi clonados localmente**
|
- ✅ **Official Wokwi repositories cloned locally**
|
||||||
- ✅ **wokwi-elements** - Componentes web electrónicos
|
- ✅ **wokwi-elements** - Electronic web components
|
||||||
- ✅ **avr8js** - Emulador AVR8
|
- ✅ **avr8js** - AVR8 emulator
|
||||||
- ✅ **rp2040js** - Emulador RP2040 (futuro)
|
- ✅ **rp2040js** - RP2040 emulator (future)
|
||||||
- ✅ Componentes visuales usando wokwi-elements (Arduino Uno, LEDs, etc.)
|
- ✅ Visual components using wokwi-elements (Arduino Uno, LEDs, etc.)
|
||||||
- ⏳ Emulación completa con avr8js (en progreso)
|
- ⏳ Full emulation with avr8js (in progress)
|
||||||
- ⏳ Persistencia con SQLite (próximamente)
|
- ⏳ SQLite persistence (coming soon)
|
||||||
|
|
||||||
## Requisitos Previos
|
## Prerequisites
|
||||||
|
|
||||||
### 1. Node.js
|
### 1. Node.js
|
||||||
- Versión 18 o superior
|
- Version 18 or higher
|
||||||
- Descargar desde: https://nodejs.org/
|
- Download from: https://nodejs.org/
|
||||||
|
|
||||||
### 2. Python
|
### 2. Python
|
||||||
- Versión 3.12 o superior
|
- Version 3.12 or higher
|
||||||
- Descargar desde: https://www.python.org/
|
- Download from: https://www.python.org/
|
||||||
|
|
||||||
### 3. Arduino CLI
|
### 3. Arduino CLI
|
||||||
Instalar arduino-cli en tu sistema:
|
Install arduino-cli on your system:
|
||||||
|
|
||||||
**Windows (con Chocolatey):**
|
**Windows (with Chocolatey):**
|
||||||
```bash
|
```bash
|
||||||
choco install arduino-cli
|
choco install arduino-cli
|
||||||
```
|
```
|
||||||
|
|
||||||
**Windows (manual):**
|
**Windows (manual):**
|
||||||
1. Descargar desde: https://github.com/arduino/arduino-cli/releases
|
1. Download from: https://github.com/arduino/arduino-cli/releases
|
||||||
2. Añadir al PATH del sistema
|
2. Add to system PATH
|
||||||
|
|
||||||
**Verificar instalación:**
|
**Verify installation:**
|
||||||
```bash
|
```bash
|
||||||
arduino-cli version
|
arduino-cli version
|
||||||
```
|
```
|
||||||
|
|
||||||
**Inicializar arduino-cli:**
|
**Initialize arduino-cli:**
|
||||||
```bash
|
```bash
|
||||||
arduino-cli core update-index
|
arduino-cli core update-index
|
||||||
arduino-cli core install arduino:avr
|
arduino-cli core install arduino:avr
|
||||||
```
|
```
|
||||||
|
|
||||||
## Instalación
|
## Installation
|
||||||
|
|
||||||
### 1. Clonar el repositorio
|
### 1. Clone the repository
|
||||||
```bash
|
```bash
|
||||||
cd e:\Hardware\wokwi_clon
|
cd e:\Hardware\wokwi_clon
|
||||||
```
|
```
|
||||||
|
|
||||||
### 2. Configurar el Backend
|
### 2. Setup Backend
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd backend
|
cd backend
|
||||||
|
|
||||||
# Crear entorno virtual
|
# Create virtual environment
|
||||||
python -m venv venv
|
python -m venv venv
|
||||||
|
|
||||||
# Activar entorno virtual (Windows)
|
# Activate virtual environment (Windows)
|
||||||
venv\Scripts\activate
|
venv\Scripts\activate
|
||||||
|
|
||||||
# Instalar dependencias
|
# Install dependencies
|
||||||
pip install -r requirements.txt
|
pip install -r requirements.txt
|
||||||
```
|
```
|
||||||
|
|
||||||
### 3. Configurar el Frontend
|
### 3. Setup Frontend
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd frontend
|
cd frontend
|
||||||
|
|
||||||
# Instalar dependencias
|
# Install dependencies
|
||||||
npm install
|
npm install
|
||||||
```
|
```
|
||||||
|
|
||||||
## Ejecución
|
## Running
|
||||||
|
|
||||||
### Iniciar el Backend
|
### Start Backend
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd backend
|
cd backend
|
||||||
|
|
@ -88,120 +88,120 @@ venv\Scripts\activate
|
||||||
uvicorn app.main:app --reload --port 8001
|
uvicorn app.main:app --reload --port 8001
|
||||||
```
|
```
|
||||||
|
|
||||||
El backend estará disponible en:
|
The backend will be available at:
|
||||||
- API: http://localhost:8001
|
- API: http://localhost:8001
|
||||||
- Documentación: http://localhost:8001/docs
|
- Documentation: http://localhost:8001/docs
|
||||||
|
|
||||||
### Iniciar el Frontend
|
### Start Frontend
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd frontend
|
cd frontend
|
||||||
npm run dev
|
npm run dev
|
||||||
```
|
```
|
||||||
|
|
||||||
El frontend estará disponible en:
|
The frontend will be available at:
|
||||||
- App: http://localhost:5173
|
- App: http://localhost:5173
|
||||||
|
|
||||||
## Uso
|
## Usage
|
||||||
|
|
||||||
1. Abre http://localhost:5173 en tu navegador
|
1. Open http://localhost:5173 in your browser
|
||||||
2. Escribe código Arduino en el editor (hay un ejemplo de Blink por defecto)
|
2. Write Arduino code in the editor (there's a Blink example by default)
|
||||||
3. Click en "Compile" para compilar el código
|
3. Click "Compile" to compile the code
|
||||||
4. Si la compilación es exitosa, click en "Run" para iniciar la simulación
|
4. If compilation is successful, click "Run" to start the simulation
|
||||||
5. Observa el LED simulado parpadeando
|
5. Watch the simulated LED blinking
|
||||||
|
|
||||||
## Estructura del Proyecto
|
## Project Structure
|
||||||
|
|
||||||
```
|
```
|
||||||
wokwi_clon/
|
wokwi_clon/
|
||||||
├── frontend/ # React + Vite
|
├── frontend/ # React + Vite
|
||||||
│ ├── src/
|
│ ├── src/
|
||||||
│ │ ├── components/ # Componentes React
|
│ │ ├── components/ # React components
|
||||||
│ │ │ ├── components-wokwi/ # Wrappers de wokwi-elements
|
│ │ │ ├── components-wokwi/ # wokwi-elements wrappers
|
||||||
│ │ │ ├── editor/ # Editor Monaco
|
│ │ │ ├── editor/ # Monaco Editor
|
||||||
│ │ │ └── simulator/ # Canvas de simulación
|
│ │ │ └── simulator/ # Simulation canvas
|
||||||
│ │ ├── store/ # Estado global (Zustand)
|
│ │ ├── store/ # Global state (Zustand)
|
||||||
│ │ ├── services/ # API clients
|
│ │ ├── services/ # API clients
|
||||||
│ │ └── App.tsx # Componente principal
|
│ │ └── App.tsx # Main component
|
||||||
│ └── package.json
|
│ └── package.json
|
||||||
│
|
│
|
||||||
├── backend/ # FastAPI + Python
|
├── backend/ # FastAPI + Python
|
||||||
│ ├── app/
|
│ ├── app/
|
||||||
│ │ ├── api/routes/ # Endpoints REST
|
│ │ ├── api/routes/ # REST endpoints
|
||||||
│ │ ├── services/ # Lógica de negocio
|
│ │ ├── services/ # Business logic
|
||||||
│ │ └── main.py # Entry point
|
│ │ └── main.py # Entry point
|
||||||
│ └── requirements.txt
|
│ └── requirements.txt
|
||||||
│
|
│
|
||||||
├── wokwi-libs/ # Repositorios de Wokwi clonados
|
├── wokwi-libs/ # Cloned Wokwi repositories
|
||||||
│ ├── wokwi-elements/ # Web Components
|
│ ├── wokwi-elements/ # Web Components
|
||||||
│ ├── avr8js/ # Emulador AVR8
|
│ ├── avr8js/ # AVR8 Emulator
|
||||||
│ ├── rp2040js/ # Emulador RP2040
|
│ ├── rp2040js/ # RP2040 Emulator
|
||||||
│ └── wokwi-features/ # Features y documentación
|
│ └── wokwi-features/ # Features and documentation
|
||||||
│
|
│
|
||||||
├── README.md
|
├── README.md
|
||||||
├── WOKWI_LIBS.md # Documentación de integración Wokwi
|
├── WOKWI_LIBS.md # Wokwi integration documentation
|
||||||
└── update-wokwi-libs.bat # Script de actualización
|
└── update-wokwi-libs.bat # Update script
|
||||||
```
|
```
|
||||||
|
|
||||||
## Tecnologías Utilizadas
|
## Technologies Used
|
||||||
|
|
||||||
### Frontend
|
### Frontend
|
||||||
- **React** 18 - Framework UI
|
- **React** 18 - UI framework
|
||||||
- **Vite** 5 - Build tool
|
- **Vite** 5 - Build tool
|
||||||
- **TypeScript** - Tipado estático
|
- **TypeScript** - Static typing
|
||||||
- **Monaco Editor** - Editor de código (VSCode)
|
- **Monaco Editor** - Code editor (VSCode)
|
||||||
- **Zustand** - State management
|
- **Zustand** - State management
|
||||||
- **Axios** - HTTP client
|
- **Axios** - HTTP client
|
||||||
|
|
||||||
### Backend
|
### Backend
|
||||||
- **FastAPI** - Framework web Python
|
- **FastAPI** - Python web framework
|
||||||
- **uvicorn** - ASGI server
|
- **uvicorn** - ASGI server
|
||||||
- **arduino-cli** - Compilador Arduino
|
- **arduino-cli** - Arduino compiler
|
||||||
- **SQLAlchemy** - ORM (próximamente)
|
- **SQLAlchemy** - ORM (coming soon)
|
||||||
- **SQLite** - Base de datos (próximamente)
|
- **SQLite** - Database (coming soon)
|
||||||
|
|
||||||
### Simulación
|
### Simulation
|
||||||
- **avr8js** - Emulador AVR8 (próximamente)
|
- **avr8js** - AVR8 emulator (coming soon)
|
||||||
- **@wokwi/elements** - Componentes electrónicos (próximamente)
|
- **@wokwi/elements** - Electronic components (coming soon)
|
||||||
|
|
||||||
## Próximas Funcionalidades
|
## Upcoming Features
|
||||||
|
|
||||||
### Fase 2: Emulación Real con avr8js
|
### Phase 2: Real Emulation with avr8js
|
||||||
- [ ] Integrar avr8js para emulación real del ATmega328p
|
- [ ] Integrate avr8js for real ATmega328p emulation
|
||||||
- [ ] Parser de archivos .hex
|
- [ ] .hex file parser
|
||||||
- [ ] PinManager para gestión de pines
|
- [ ] PinManager for pin management
|
||||||
- [ ] Ejecución en tiempo real
|
- [ ] Real-time execution
|
||||||
|
|
||||||
### Fase 3: Componentes Visuales
|
### Phase 3: Visual Components
|
||||||
- [ ] Integrar @wokwi/elements
|
- [ ] Integrate @wokwi/elements
|
||||||
- [ ] Componente LED con estado real
|
- [ ] LED component with real state
|
||||||
- [ ] Componente Resistor
|
- [ ] Resistor component
|
||||||
- [ ] Drag & drop de componentes
|
- [ ] Component drag & drop
|
||||||
- [ ] Conexiones visuales (wires)
|
- [ ] Visual connections (wires)
|
||||||
|
|
||||||
### Fase 4: Persistencia
|
### Phase 4: Persistence
|
||||||
- [ ] Base de datos SQLite
|
- [ ] SQLite database
|
||||||
- [ ] CRUD de proyectos
|
- [ ] Project CRUD
|
||||||
- [ ] Guardar/cargar código y circuito
|
- [ ] Save/load code and circuit
|
||||||
- [ ] Historial de proyectos
|
- [ ] Project history
|
||||||
|
|
||||||
### Fase 5: Funcionalidades Avanzadas
|
### Phase 5: Advanced Features
|
||||||
- [ ] Más componentes (botones, potenciómetros, sensores)
|
- [ ] More components (buttons, potentiometers, sensors)
|
||||||
- [ ] Serial monitor
|
- [ ] Serial monitor
|
||||||
- [ ] Control de velocidad de simulación
|
- [ ] Simulation speed control
|
||||||
- [ ] Proyectos de ejemplo
|
- [ ] Example projects
|
||||||
- [ ] Exportar/importar proyectos
|
- [ ] Export/import projects
|
||||||
|
|
||||||
## Actualizar Librerías de Wokwi
|
## Update Wokwi Libraries
|
||||||
|
|
||||||
Este proyecto usa los repositorios oficiales de Wokwi clonados localmente. Para obtener las últimas actualizaciones:
|
This project uses official Wokwi repositories cloned locally. To get the latest updates:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Ejecutar script de actualización
|
# Run update script
|
||||||
update-wokwi-libs.bat
|
update-wokwi-libs.bat
|
||||||
```
|
```
|
||||||
|
|
||||||
O manualmente:
|
Or manually:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd wokwi-libs/wokwi-elements
|
cd wokwi-libs/wokwi-elements
|
||||||
|
|
@ -210,38 +210,38 @@ npm install
|
||||||
npm run build
|
npm run build
|
||||||
```
|
```
|
||||||
|
|
||||||
Ver [WOKWI_LIBS.md](WOKWI_LIBS.md) para más detalles sobre la integración con Wokwi.
|
See [WOKWI_LIBS.md](WOKWI_LIBS.md) for more details about Wokwi integration.
|
||||||
|
|
||||||
## Solución de Problemas
|
## Troubleshooting
|
||||||
|
|
||||||
### Error: "arduino-cli: command not found"
|
### Error: "arduino-cli: command not found"
|
||||||
- Asegúrate de tener arduino-cli instalado y en el PATH
|
- Make sure arduino-cli is installed and in PATH
|
||||||
- Verifica con: `arduino-cli version`
|
- Verify with: `arduino-cli version`
|
||||||
|
|
||||||
### Error: "arduino:avr core not found"
|
### Error: "arduino:avr core not found"
|
||||||
- Ejecuta: `arduino-cli core install arduino:avr`
|
- Run: `arduino-cli core install arduino:avr`
|
||||||
|
|
||||||
### El frontend no conecta con el backend
|
### Frontend doesn't connect to backend
|
||||||
- Verifica que el backend esté corriendo en http://localhost:8001
|
- Verify backend is running at http://localhost:8001
|
||||||
- Verifica los logs de CORS en la consola del navegador
|
- Check CORS logs in browser console
|
||||||
|
|
||||||
### Errores de compilación
|
### Compilation errors
|
||||||
- Revisa la consola del backend para ver los logs de arduino-cli
|
- Check backend console for arduino-cli logs
|
||||||
- Asegúrate de que el código Arduino sea válido
|
- Make sure Arduino code is valid
|
||||||
- Verifica que tienes instalado el core `arduino:avr`
|
- Verify you have the `arduino:avr` core installed
|
||||||
|
|
||||||
## Contribuir
|
## Contributing
|
||||||
|
|
||||||
Este es un proyecto educativo. Sugerencias y mejoras son bienvenidas!
|
This is an educational project. Suggestions and improvements are welcome!
|
||||||
|
|
||||||
## Licencia
|
## License
|
||||||
|
|
||||||
MIT
|
MIT
|
||||||
|
|
||||||
## Referencias
|
## References
|
||||||
|
|
||||||
- [Wokwi](https://wokwi.com) - Inspiración del proyecto
|
- [Wokwi](https://wokwi.com) - Project inspiration
|
||||||
- [avr8js](https://github.com/wokwi/avr8js) - Emulador AVR8
|
- [avr8js](https://github.com/wokwi/avr8js) - AVR8 emulator
|
||||||
- [wokwi-elements](https://github.com/wokwi/wokwi-elements) - Componentes web
|
- [wokwi-elements](https://github.com/wokwi/wokwi-elements) - Web components
|
||||||
- [arduino-cli](https://github.com/arduino/arduino-cli) - Compilador Arduino
|
- [arduino-cli](https://github.com/arduino/arduino-cli) - Arduino compiler
|
||||||
- [Monaco Editor](https://microsoft.github.io/monaco-editor/) - Editor de código
|
- [Monaco Editor](https://microsoft.github.io/monaco-editor/) - Code editor
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue