<commit_before>#include <Automaton.h>
#include <Atm_led.h>
#include <Atm_button.h>

// This example demonstrates running state machines logging their state changes to the serial port

int led1Pin = 3;
int led2Pin = 4;
int buttonPin = 11;

Atm_led led1, led2;
Atm_button btn;
Factory factory;

void sw( const char label[], const char current[], const char next[], const char trigger[], uint32_t runtime, uint32_t cycles ) {
  Serial.print( millis() );
  Serial.print( " Switching " );
  Serial.print( label );
  Serial.print( " from state " );
  Serial.print( current );
  Serial.print( " to " );
  Serial.print( next );
  Serial.print( " on trigger " );
  Serial.print( trigger );
  Serial.print( " (" );
  Serial.print( cycles );
  Serial.print( " cycles in " );
  Serial.print( runtime );
  Serial.println( " ms)" );
}

void cb( int press ) {

}

void setup() {
  Serial.begin( 9600 );
  delay( 1000 );
  Serial.println( "start" );
  led1.begin( led1Pin ).blink( 200 ).state( led1.START );
  led2.begin( led2Pin ).blink( 300 ).state( led2.START );
  led1.label( "LED1" ).onSwitch( sw, "IDLE\0ON\0START\0BLINK_OFF", "EVT_ON_TIMER\0EVT_OFF_TIMER\0EVT_COUNTER\0ELSE" );
  led2.label( "LED2" ).onSwitch( sw, "IDLE\0ON\0START\0BLINK_OFF", "EVT_ON_TIMER\0EVT_OFF_TIMER\0EVT_COUNTER\0ELSE" );
  btn.begin( buttonPin, cb ).onSwitch( sw,
    "IDLE\0WAIT\0PRESSED\0REPEAT\0RELEASE\0LIDLE\0LWAIT\0LPRESSED\0LRELEASE\0WRELEASE\0AUTO",
    "EVT_LMODE\0EVT_TIMER\0EVT_DELAY\0EVT_REPEAT\0EVT_PRESS\0EVT_RELEASE\0EVT_COUNTER\0EVT_AUTO\0ELSE" ); 
  factory.add( led1).add( led2 ).add( btn );  
}

void loop() {
  factory.cycle();
}<commit_msg>Fixed example/led_test to use built in debugging<commit_after>#include <Automaton.h>
#include <Atm_led.h>
#include <Atm_button.h>

// This example demonstrates running state machines logging their state changes to the serial port

int led1Pin = 3;
int led2Pin = 4;
int buttonPin = 11;

Atm_led led1, led2;
Atm_button btn;
Factory factory;

void cb( int press ) {

}

void setup() {
  Serial.begin( 9600 );
  led1.begin( led1Pin ).blink( 200 ).state( led1.START );
  led2.begin( led2Pin ).blink( 300 ).state( led2.START );
  led1.onSwitch( atm_serial_debug::onSwitch ).label( "LED1" );
  led2.onSwitch( atm_serial_debug::onSwitch ).label( "LED2" );
  btn.begin( buttonPin, cb ).onSwitch( atm_serial_debug::onSwitch );
  factory.add( led1).add( led2 ).add( btn );  
}

void loop() {
  factory.cycle();
}
{'fraction_non_alphanumeric': 0.15026759983532317, 'fraction_numerical': 0.040345821325648415, 'mean_word_length': 4.159235668789809, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4798513', 'n_tokens_mistral': 979, 'n_tokens_neox': 944, 'n_words': 218}