Electronic Counter
Edge-triggered counter module with 0-9 display and wraparound pulse output.
Overview
The Electronic Counter is an edge-triggered logic module that tracks pulse events on input_1 and displays a count (0-9) on its animated 7-segment display. When the count wraps from 9 back to 0, it outputs a momentary pulse on output_0. The counter continuously monitors input_0 for power availability and applies a 200ms debounce to prevent false triggers. Use it to count events, create cyclic automation patterns, or trigger actions after a specific number of iterations.
Specifications
| Property | Value |
|---|---|
| Type | Passthrough (2 IN + 1 OUT) with gate |
| Power Consumption | 5 u/s |
| Output Capacity | 20 u/s |
| Ports | input_0 (power), input_1 (toggle), output_0 (pulse) |
| Counter Range | 0-9 (wraps to 0 at 10) |
| Pulse Duration | 2000 ms |
| Debounce Time | 200 ms |
| Display | Animated 7-segment (show_0 through show_9) |
| Weight (placed) | 800 g |
| Weight (kit) | 600 g |
| Class Name | LFPG_ElectronicCounter |
| Base Class | LFPG_WireOwnerBase |
How It Works
The Electronic Counter operates as an edge-triggered module. It monitors two separate inputs: input_0 (power/gate signal) and input_1 (toggle/increment signal). On each rising edge detected on input_1, the counter increments its internal value by 1. The counter maintains a state from 0 to 9, and when it reaches 9 and receives another pulse, it wraps back to 0 while simultaneously outputting a 2000ms pulse on output_0.
A 200ms debounce window prevents accidental double-triggers from noisy signals. The 7-segment display animates through states (show_0 through show_9) to visually reflect the current count. The gate (power) on input_0 must be active for the counter to respond to toggle pulses.
LED Indicator
- Green: Gate is open (input_0 active)
- Red: Gate is closed (input_0 inactive or low power)
- Off: No power available
Wiring Examples
Count Events (Every 10 Presses)
Power supply for counter. Push Button provides input_1. After 10 presses, Counter (output_0) triggers Door Controller.
Cyclic Automation
Power supply for counter. Pressure Pad provides input_1. Counter (output_0) triggers Timer (10 seconds) → Alarm every 10 steps.
Combo Lock System
Power supply for counter. Button 1 provides input_1. After 10 presses, Counter (output_0) combines with Button 2 via AND Gate to release Lock.
Tips
- The 200ms debounce filters noise—if rapid pulses arrive faster than 200ms apart, some may be ignored.
- Use the visible 7-segment display to debug your counting logic in real-time.
- Combine with a Memory Cell if you need the wraparound pulse to persist longer than 2 seconds.
- The counter consumes 5 u/s continuously when powered, regardless of whether it's counting.
- Chain multiple counters for modular counting up to 99 (10 × 10).
Descripción General
El Contador Electrónico es un módulo lógico activado por borde que rastrea eventos de pulso en input_1 y muestra un conteo (0-9) en su pantalla de 7 segmentos animada. Cuando el conteo se ajusta de 9 vuelto a 0, emite un pulso momentáneo en output_0. El contador monitorea continuamente input_0 para poder disponibilidad y aplica un rechazo de 200ms para prevenir disparadores falsos. Úsalo para contar eventos, crear patrones de automatización cíclica, o activar acciones después de un número específico de iteraciones.
Especificaciones
| Propiedad | Valor |
|---|---|
| Tipo | Passthrough (2 entrada + 1 salida) con puerta |
| Consumo de Energía | 5 u/s |
| Capacidad de Salida | 20 u/s |
| Puertos | input_0 (energía), input_1 (alternancia), output_0 (pulso) |
| Rango del Contador | 0-9 (se ajusta a 0 en 10) |
| Duración del Pulso | 2000 ms |
| Tiempo de Rechazo | 200 ms |
| Pantalla | 7 segmentos animado (show_0 a show_9) |
| Peso (colocado) | 800 g |
| Peso (kit) | 600 g |
| Nombre de Clase | LFPG_ElectronicCounter |
| Clase Base | LFPG_WireOwnerBase |
Cómo Funciona
El Contador Electrónico funciona como un módulo activado por borde. Monitorea dos entradas separadas: input_0 (señal de poder/puerta) e input_1 (señal de alternancia/incremento). En cada borde ascendente detectado en input_1, el contador incrementa su valor interno en 1. El contador mantiene un estado de 0 a 9, y cuando alcanza 9 y recibe otro pulso, se ajusta de nuevo a 0 mientras simultáneamente emite un pulso de 2000ms en output_0.
Una ventana de rechazo de 200ms previene disparadores dobles accidentales de señales ruidosas. Los 7 segmentos la pantalla se anima a través de estados (show_0 a show_9) para reflejar visualmente el conteo actual. La puerta (poder) en input_0 debe estar activa para que el contador responda a pulsos de alternancia.
Indicador LED
- Verde: Puerta abierta (input_0 activo)
- Rojo: Puerta cerrada (input_0 inactivo o bajo poder)
- Apagado: Sin poder disponible
Ejemplos de Cableado
Contar Eventos (Cada 10 Pulsaciones)
Suministro de energía para contador. Botón Presión proporciona input_1. Después de 10 pulsaciones, Contador (output_0) activa Controlador de Puerta.
Automatización Cíclica
Suministro de energía para contador. Plataforma de Presión proporciona input_1. Contador (output_0) activa Temporizador (10 segundos) → Alarma cada 10 pasos.
Sistema de Cierre Combinado
Suministro de energía para contador. Botón 1 proporciona input_1. Después de 10 pulsaciones, Contador (output_0) se combina con Botón 2 vía Puerta AND para liberar Cierre.
Consejos
- El rechazo de 200ms filtra ruido—si pulsos rápidos llegan más rápido que cada 200ms, algunos pueden ser ignorados.
- Usa la pantalla de 7 segmentos visible para depurar tu lógica de conteo en tiempo real.
- Combina con una Celda de Memoria si necesitas que el pulso de ajuste persista más de 2 segundos.
- El contador consume 5 u/s continuamente cuando está con poder, independientemente de si está contando.
- Encadena múltiples contadores para conteo modular hasta 99 (10 × 10).
Обзор
Электронный счетчик — это логический модуль с срабатыванием по фронту, который отслеживает события импульса на input_1 и отображает счет (0-9) на своем анимированном 7-сегментном дисплее. Когда счет переходит с 9 обратно на 0, он выдает мгновенный импульс на output_0. Счетчик постоянно контролирует input_0 для питания доступность и применяет дребезг 200ms для предотвращения ложных срабатываний. Используйте его для подсчета событий, создания циклических шаблонов автоматизации или активации действий после определенного числа итераций.
Спецификации
| Свойство | Значение |
|---|---|
| Тип | Passthrough (2 вх + 1 вых) с затвором |
| Потребление энергии | 5 u/s |
| Пропускная способность выхода | 20 u/s |
| Портов | input_0 (питание), input_1 (переключение), output_0 (импульс) |
| Диапазон счетчика | 0-9 (переходит на 0 в 10) |
| Длительность импульса | 2000 ms |
| Время дребезга | 200 ms |
| Дисплей | Анимированный 7-сегментный (show_0 до show_9) |
| Вес (установленный) | 800 g |
| Вес (набор) | 600 g |
| Имя класса | LFPG_ElectronicCounter |
| Базовый класс | LFPG_WireOwnerBase |
Как это работает
Электронный счетчик работает как модуль с срабатыванием по фронту. Он контролирует два отдельных входа: input_0 (сигнал питания/затвора) и input_1 (сигнал переключения/приращения). При каждом обнаруженном фронте возрастания на input_1 счетчик увеличивает его внутреннее значение на 1. Счетчик поддерживает состояние от 0 до 9, и когда он достигает 9 и получает другой импульс, он переходит обратно на 0 одновременно выдавая импульс 2000ms на output_0.
Окно дребезга 200ms предотвращает случайные двойные срабатывания от шумных сигналов. 7-сегментный дисплей анимируется через состояния (show_0 до show_9) чтобы визуально отражать текущий счет. Затвор (питание) на input_0 должен быть активным для того, чтобы счетчик реагировал на импульсы переключения.
Индикатор светодиода
- Зеленый: Затвор открыт (input_0 активен)
- Красный: Затвор закрыт (input_0 неактивен или низкая мощность)
- Выключено: Нет доступной энергии
Примеры подключения
Подсчет событий (каждые 10 нажатий)
Источник питания счетчика. Кнопка нажатия обеспечивает input_1. После 10 нажатий Счетчик (output_0) активирует Контроллер двери.
Циклическая автоматизация
Источник питания счетчика. Платформа давления обеспечивает input_1. Счетчик (output_0) активирует Таймер (10 секунд) → Тревога каждые 10 шагов.
Система комбинированной блокировки
Источник питания счетчика. Кнопка 1 обеспечивает input_1. После 10 нажатий Счетчик (output_0) объединяется с Кнопкой 2 через Вентиль AND для отпуска блокировки.
Советы
- Дребезг 200ms фильтрует шум—если быстрые импульсы прибывают быстрее чем 200ms друг от друга, некоторые могут быть проигнорированы.
- Используйте видимый 7-сегментный дисплей для отладки вашей логики подсчета в реальном времени.
- Объедините с Ячейкой памяти если вам нужно, чтобы импульс переноса сохранялся дольше 2 секунд.
- Счетчик потребляет 5 u/s непрерывно когда питание включено, независимо от того, подсчитывает ли он.
- Цепляйте несколько счетчиков для модульного подсчета до 99 (10 × 10).