//----------------------------------------------
//
//         Sketch Generated by Visuino
//               www.visuino.com
//           Version 8.0.0.101
//
//------------------ Source --------------------
//
// EARTHQUAKE DETECTOR 1 TRANSISTOR.visuino
//
//----------------------------------------------

#define VISUINO_ARDUINO_NANO
#define _MITOV_DISPLAY_SSD1306_I2C

#include <OpenWire.h>
#include <Mitov.h>
#include <Wire.h>
#include <Mitov_Basic_I2C.h>
#include <Mitov_Display_SSD1306_I2C.h>
#include <Mitov_Graphics.h>
#include <Mitov_Graphics_Monochrome.h>
#include <Fonts\Fixed\GraphicsFont5x7.h>
#include <Mitov_Timing.h>
#include <Mitov_Counter.h>
#include <Mitov_Converters.h>
#include <Mitov_Math.h>
#include <Mitov_LogicFlipFlops.h>
#include <Mitov_BinaryGenerators.h>
#include <Mitov_PlayFrequencyTone.h>
#include <Mitov_LogicGates.h>


// Shared Component Member Variables

namespace ComponentVariables
{
class
{
public:
  bool Value1 : 1;
  bool Value2 : 1;
  bool Value4 : 1;
  bool Value5 : 1;
  bool Value6 : 1;
  bool Value7 : 1;
  bool Value8 : 1;
  bool Value9 : 1;
  bool Value10 : 1;
  bool Value11 : 1;
  bool Value12 : 1;
  bool Value13 : 1;
  bool Value14 : 1;
  bool Value15 : 1;
  bool Value16 : 1;
  bool Value17 : 1;
  uint32_t Value3 : 8;
  bool Value18 : 1;
  bool Value19 : 1;

} BitFields;

class Variable1
{
public:
  inline static bool GetValue() { return BitFields.Value1; }
  inline static void SetValue( bool AValue ) { BitFields.Value1 = AValue; }

};

class Variable2
{
public:
  inline static bool GetValue() { return BitFields.Value2; }
  inline static void SetValue( bool AValue ) { BitFields.Value2 = AValue; }

};

class Variable4
{
public:
  inline static bool GetValue() { return BitFields.Value4; }
  inline static void SetValue( bool AValue ) { BitFields.Value4 = AValue; }

};

class Variable5
{
public:
  inline static bool GetValue() { return BitFields.Value5; }
  inline static void SetValue( bool AValue ) { BitFields.Value5 = AValue; }

};

class Variable6
{
public:
  inline static bool GetValue() { return BitFields.Value6; }
  inline static void SetValue( bool AValue ) { BitFields.Value6 = AValue; }

};

class Variable7
{
public:
  inline static bool GetValue() { return BitFields.Value7; }
  inline static void SetValue( bool AValue ) { BitFields.Value7 = AValue; }

};

class Variable8
{
public:
  inline static bool GetValue() { return BitFields.Value8; }
  inline static void SetValue( bool AValue ) { BitFields.Value8 = AValue; }

};

class Variable9
{
public:
  inline static bool GetValue() { return BitFields.Value9; }
  inline static void SetValue( bool AValue ) { BitFields.Value9 = AValue; }

};

class Variable10
{
public:
  inline static bool GetValue() { return BitFields.Value10; }
  inline static void SetValue( bool AValue ) { BitFields.Value10 = AValue; }

};

class Variable11
{
public:
  inline static bool GetValue() { return BitFields.Value11; }
  inline static void SetValue( bool AValue ) { BitFields.Value11 = AValue; }

};

class Variable12
{
public:
  inline static bool GetValue() { return BitFields.Value12; }
  inline static void SetValue( bool AValue ) { BitFields.Value12 = AValue; }

};

class Variable13
{
public:
  inline static bool GetValue() { return BitFields.Value13; }
  inline static void SetValue( bool AValue ) { BitFields.Value13 = AValue; }

};

class Variable14
{
public:
  inline static bool GetValue() { return BitFields.Value14; }
  inline static void SetValue( bool AValue ) { BitFields.Value14 = AValue; }

};

class Variable15
{
public:
  inline static bool GetValue() { return BitFields.Value15; }
  inline static void SetValue( bool AValue ) { BitFields.Value15 = AValue; }

};

class Variable16
{
public:
  inline static bool GetValue() { return BitFields.Value16; }
  inline static void SetValue( bool AValue ) { BitFields.Value16 = AValue; }

};

class Variable17
{
public:
  inline static bool GetValue() { return BitFields.Value17; }
  inline static void SetValue( bool AValue ) { BitFields.Value17 = AValue; }

};

class Variable3
{
public:
  inline static uint32_t GetValue() { return BitFields.Value3; }
  inline static void SetValue( uint32_t AValue ) { BitFields.Value3 = AValue; }

};

class Variable18
{
public:
  inline static bool GetValue() { return BitFields.Value18; }
  inline static void SetValue( bool AValue ) { BitFields.Value18 = AValue; }

};

class Variable19
{
public:
  inline static bool GetValue() { return BitFields.Value19; }
  inline static void SetValue( bool AValue ) { BitFields.Value19 = AValue; }

};

class Shared_bool_0 : public ::ComponentVariables::Variable7
{
protected:
  static bool FValue;

public:
  inline static bool GetVariableValue( const bool AInitialValue )
  {
    if( ::ComponentVariables::Variable7::GetValue() )
      return FValue;

    return AInitialValue;
  }

  inline static void SetVariableValue( const bool AValue ) { FValue = AValue; ::ComponentVariables::Variable7::SetValue( true ); }
  inline static bool &GetReference() { return FValue; }

  inline Shared_bool_0() { ::ComponentVariables::Variable7::SetValue( false ); }

};

bool Shared_bool_0::FValue;

} // ComponentVariables

// Arduino Constant Declarations

namespace VisuinoConstants
{
class FloatValue2
{
public:
    inline static constexpr float GetValue() { return 1; }
};

class FloatValue12
{
public:
    inline static constexpr float GetValue() { return -65; }
};

class FloatValue1
{
public:
    inline static constexpr float GetValue() { return 7; }
};

class FloatValue11
{
public:
    inline static constexpr float GetValue() { return 6; }
};

class FloatValue0
{
public:
    inline static constexpr float GetValue() { return 0.811999976634979; }
};

class FloatValue3
{
public:
    inline static constexpr float GetValue() { return 0.150000005960464; }
};

class FloatValue4
{
public:
    inline static constexpr float GetValue() { return 0.349999994039536; }
};

class FloatValue5
{
public:
    inline static constexpr float GetValue() { return -100; }
};

class FloatValue6
{
public:
    inline static constexpr float GetValue() { return 100; }
};

class FloatValue7
{
public:
    inline static constexpr float GetValue() { return 0; }
};

class FloatValue9
{
public:
    inline static constexpr float GetValue() { return 60; }
};

class FloatValue10
{
public:
    inline static constexpr float GetValue() { return 3000; }
};

class FloatValue8
{
public:
    inline static constexpr float GetValue() { return 4; }
};

class TextValue0
{
public:
    inline static constexpr const char *GetValue() { return "EARTHQUAKE ALERT!"; }
};

} // VisuinoConstants

// Pin Call Declarations

namespace PinCalls
{
class PinCallerReceive0
{
public:
  void Notify( void *_Data );

};
class PinCallerReceive1
{
public:
  void Notify( void *_Data );

};
class PinCallerReceive2
{
public:
  void Notify( void *_Data );

};
class PinCallerReceive3
{
public:
  void Notify( void *_Data );

};
class PinCallerReceive4
{
public:
  void Notify( void *_Data );

};
class PinCallerReceive5
{
public:
  void Notify( void *_Data );

};
class PinCallerReceive6
{
public:
  void Notify( void *_Data );

};
class PinCallerReceive7
{
public:
  void Notify( void *_Data );

};
class PinCallerReceive8
{
public:
  void Notify( void *_Data );

};
class PinCallerReceive9
{
public:
  void Notify( void *_Data );

};
class PinCallerReceive10
{
public:
  void Notify( void *_Data );

};
class PinCallerReceive11
{
public:
  void Notify( void *_Data );

};
class PinCallerReceive12
{
public:
  void Notify( void *_Data );

};
} // PinCalls

// Call Chains

namespace CallChains
{
class SendByte1
{
public:
  inline static constexpr uint32_t Count() { return 1; }
  static void Call( uint8_t AValue );

};
class RequestData1
{
public:
  inline static constexpr uint32_t Count() { return 1; }
  static void Call();

};
class Render1
{
public:
  inline static constexpr uint32_t Count() { return 0; }
  static void Call();

};
class PeriodicCall1
{
public:
  inline static constexpr uint32_t Count() { return 0; }
  static void Call();

};
class TryActive1
{
public:
  inline static constexpr uint32_t Count() { return 1; }
  static void Call( bool & AResult );

};
} // CallChains

// System Objects Declarations

namespace BoardDeclarations
{
Mitov::TPeriodMicros<142858, ::CallChains::PeriodicCall1> SystemPeriodMicros_142858;
} // BoardDeclarations

// Arduino Board Declarations

namespace BoardDeclarations
{
namespace Types
{
typedef Mitov::ArduinoDigitalInputChannel<
  Mitov::ConstantProperty<51, bool, false >, // InitialValue = 0
  Mitov::ConstantProperty<25, bool, false >, // IsOpenDrain = 0
  Mitov::ConstantProperty<25, bool, true >, // IsOutput = -1
  Mitov::ConstantProperty<20, bool, false >, // IsPullDown = 0
  Mitov::ConstantProperty<5, bool, false >, // IsPullUp = False (Default)
  Mitov::DigitalPin_NoImplementation<6 >, // OutputPin
  4 // PIN_DIGITAL
  > ArduinoDigitalChannel_4;
} // Types

namespace Instances
{
Types::ArduinoDigitalChannel_4 ArduinoDigitalChannel_4;
} // Instances

namespace Types
{
typedef Mitov::ArduinoAnalogInputChannel<0, Mitov::AnalogPin_EmbeddedPinImplementation<6, ::PinCalls::PinCallerReceive0 > > ArduinoAnalogInputChannel_0;
} // Types

namespace Instances
{
Types::ArduinoAnalogInputChannel_0 ArduinoAnalogInputChannel_0;
} // Instances

namespace Types
{
typedef ::Mitov::ArduinoI2C<
  Wire, // 1_I2C
  Mitov::ConstantProperty<6, uint32_t, 0 >, // Address = 0 (Default)
  Mitov::EmbeddedCallChain<CallChains::RequestData1 >, // INSTANCE_RequestData
  Mitov::EmbeddedCallChain<CallChains::SendByte1 >, // INSTANCE_SendByte
  Mitov::ConstantProperty<5, bool, false >, // IsSlave = False (Default)
  Mitov::GenericPin_NoImplementation<2 >, // OutputPin
  Mitov::ClockPin_NoImplementation<4 > // RequestOutputPin
   > TArduinoI2C1;
} // Types

namespace Instances
{
Types::TArduinoI2C1 TArduinoI2C1;
} // Instances

} // BoardDeclarations

// Declarations

namespace Declarations
{
namespace Types
{
typedef Mitov::DisplaySSD1306<
  Mitov::Display_odtSSD_I2C<
      TwoWire, // 0_I2C_TYPE_PIN
      Wire, // 1_I2C_NAME_PIN
      Mitov::ConstantProperty<28, uint8_t, 60 > // Address = 60 (Default)
       >, // 0_IMPLEMENTATION
  Mitov::DisplaySSD1306Buffered<
      64, // Height
      128 // Width
       >, // 0_IMPLEMENTATION_BUFFER
  Mitov::DisplayOrientationUp, // 0_IMPLEMENTATION_ORIENTATION
  Mitov::ConstantProperty<16, Mitov::TArduinoMonochromeColor, Mitov::tmcBlack >, // BackgroundColor = tmcBlack (Default)
  Mitov::ConstantPropertyFloat<11, float, ::VisuinoConstants::FloatValue0 >, // Contrast = 0.811999976634979 (Default)
  Mitov::EmbeddedCallChain<CallChains::Render1 >, // Elements_Render
  Mitov::ConstantProperty<29, uint32_t, 0 >, // FCursorX = 0
  Mitov::ConstantProperty<31, uint32_t, 0 >, // FCursorY = 0
  Mitov::ConstantProperty<8, Mitov::TArduinoGraphicsOrientation, Mitov::goUp >, // Orientation = goUp (Default)
  Mitov::ConstantProperty<25, bool, true >, // PowerOn = True (Default)
  Mitov::NestedProperty<15, Mitov::TArduinoDisplaySSD1306PreChargePeriod<
    Mitov::ConstantProperty<13, uint32_t, 1 >, // Phase1 = 1 (Default)
    Mitov::ConstantProperty<14, uint32_t, 15 > // Phase2 = 15 (Default)
     > >, // PreChargePeriod
  Mitov::DisplaySSD1306NoReset<Mitov::DigitalPin_NoImplementation<4 > >, // ResetOutputPin
  Mitov::NestedProperty<24, Mitov::TGraphicsTextSettings<
    Mitov::ConstantProperty<23, Mitov::TArduinoMonochromeColor, Mitov::tmcNone >, // BackgroundColor = tmcNone (Default)
    Mitov::ConstantProperty<22, Mitov::TArduinoMonochromeColor, Mitov::tmcWhite >, // Color = tmcWhite (Default)
    Mitov::FixedSizeFont<GraphicsFont5x7, 6, 8>, // Font
    Mitov::ConstantProperty<19, uint32_t, 1 >, // Size = 1 (Default)
    Mitov::ConstantProperty<21, bool, false >, // UseCodePage437Symbols = False (Default)
    Mitov::ConstantProperty<20, bool, true > // Wrap = True (Default)
     > >, // Text
  Mitov::ConstantProperty<27, Mitov::TArduinoDisplayOLEDType, Mitov::odtSSD1306 >, // Type = 0 (Default)
  Mitov::ConstantProperty<10, bool, false > // UseChargePump = False (Default)
   > DisplayOLED1; // TArduinoDisplaySSD1306I2C
} // Types

namespace Instances
{
Types::DisplayOLED1 DisplayOLED1; // TArduinoDisplaySSD1306I2C
} // Instances

namespace Types
{
typedef Mitov::GraphicsElementFillScreen<
  Declarations::Types::DisplayOLED1, // 0_TYPE_OWNER
  Declarations::Instances::DisplayOLED1, // 1_NAME_OWNER
  Mitov::ConstantProperty<4, Mitov::TArduinoMonochromeColor, Mitov::tmcBlack >, // Color = tmcBlack (Default)
  Mitov::ConstantProperty<2, bool, true >, // Enabled = True (Default)
  Mitov::MonochromeColorOperations // OPERATIONS
   > TArduinoMonochromeGraphicsElementFillScreen1;
} // Types

namespace Instances
{
Types::TArduinoMonochromeGraphicsElementFillScreen1 TArduinoMonochromeGraphicsElementFillScreen1;
} // Instances

namespace Types
{
typedef Mitov::GraphicsElementDrawLine<
  Declarations::Types::DisplayOLED1, // 0_TYPE_OWNER
  Declarations::Instances::DisplayOLED1, // 1_NAME_OWNER
  Mitov::ConstantProperty<4, Mitov::TArduinoMonochromeColor, Mitov::tmcWhite >, // Color = tmcWhite (Default)
  Mitov::ConstantProperty<2, bool, true >, // Enabled = True (Default)
  Mitov::VariableProperty<8, uint32_t, 3 >, // Height = 3
  Mitov::MonochromeColorOperations, // OPERATIONS
  Mitov::ConstantProperty<7, uint32_t, 0 >, // Width = 0
  Mitov::VariableProperty<5, int32_t, 5 >, // X = 5
  Mitov::ConstantProperty<6, int32_t, 40 > // Y = 40
   > TArduinoMonochromeGraphicsDrawLine1;
} // Types

namespace Instances
{
Types::TArduinoMonochromeGraphicsDrawLine1 TArduinoMonochromeGraphicsDrawLine1;
} // Instances

namespace Types
{
typedef Mitov::GraphicsElementDrawText<
  Declarations::Types::DisplayOLED1, // 0_TYPE_OWNER
  Declarations::Instances::DisplayOLED1, // 1_NAME_OWNER
  Mitov::ConstantProperty<4, Mitov::TArduinoMonochromeColor, Mitov::tmcWhite >, // Color = tmcWhite (Default)
  Mitov::TypedVariableValue<2, bool, ::ComponentVariables::Variable1, true >, // Enabled = True (Default)
  Mitov::ConstantProperty<5, Mitov::TArduinoMonochromeColor, Mitov::tmcNone >, // FillColor = tmcNone (Default)
  Mitov::NoFont, // Font
  Mitov::MonochromeColorOperations, // OPERATIONS
  Mitov::ConstantProperty<8, uint32_t, 1 >, // Size = 1 (Default)
  Mitov::ConstantPropertyString<10, ::VisuinoConstants::TextValue0 >, // Text = "EARTHQUAKE ALERT!"
  Mitov::ConstantProperty<12, bool, false >, // UseCodePage437Symbols = False (Default)
  Mitov::ConstantProperty<11, bool, true >, // Wrap = True (Default)
  Mitov::ConstantProperty<6, int32_t, 0 >, // X = 0 (Default)
  Mitov::ConstantProperty<7, int32_t, 0 > // Y = 0 (Default)
   > TArduinoMonochromeGraphicsElementDrawText1;
} // Types

namespace Instances
{
Types::TArduinoMonochromeGraphicsElementDrawText1 TArduinoMonochromeGraphicsElementDrawText1;
} // Instances

namespace Types
{
typedef Mitov::ClockGenerator_Shared<
  Mitov::ConstantProperty<4, bool, true >, // Enabled = True (Default)
  Mitov::ConstantPropertyFloat<5, float, ::VisuinoConstants::FloatValue1 >, // Frequency = 7
  Mitov::ClockPin_EmbeddedPinImplementation<3, ::PinCalls::PinCallerReceive1 > // OutputPin
   > ClockGenerator1; // TArduinoClockGenerator
} // Types

namespace Instances
{
Types::ClockGenerator1 ClockGenerator1; // TArduinoClockGenerator
} // Instances

namespace Types
{
typedef Mitov::UpDownCounter<
  Mitov::ConstantProperty<4, bool, true >, // Enabled = True (Default)
  Mitov::TypedVariableMinMax<22, int32_t, ::ComponentVariables::Variable3, 0, 128 >, // FCount = 0
  Mitov::ConstantProperty<6, int32_t, 0 >, // InitialValue = 0 (Default)
  Mitov::NestedProperty<11, Mitov::GenericValueLimit<
    Mitov::DigitalPin_NoImplementation<8 >, // ReachedOutputPin
    Mitov::ConstantProperty<10, bool, true >, // RollOver = True (Default)
    Mitov::ConstantProperty<9, int32_t, 128 > // Value = 128
     > >, // Value_Max
  Mitov::NestedProperty<16, Mitov::GenericValueLimit<
    Mitov::DigitalPin_NoImplementation<13 >, // ReachedOutputPin
    Mitov::ConstantProperty<15, bool, true >, // RollOver = True (Default)
    Mitov::ConstantProperty<14, int32_t, 0 > // Value = 0
     > >, // Value_Min
  Mitov::TypedVariable<20, bool, ::ComponentVariables::Variable2 >, // NeedsUpdate = 0
  Mitov::TypedPin_EmbeddedPinImplementation<3, ::PinCalls::PinCallerReceive2, int32_t > // OutputPin
   > UpDownCounter1; // TArduinoUpDownCounter
} // Types

namespace Instances
{
Types::UpDownCounter1 UpDownCounter1; // TArduinoUpDownCounter
} // Instances

namespace Types
{
typedef Mitov::AnalogToUnsigned<
  Mitov::ConstantProperty<7, bool, true >, // Constrain = True (Default)
  Mitov::TypedPin_EmbeddedPinImplementation<5, ::PinCalls::PinCallerReceive3, uint32_t >, // OutputPin
  Mitov::ConstantProperty<6, bool, true >, // Round = True (Default)
  Mitov::ConstantPropertyFloat<4, float, ::VisuinoConstants::FloatValue2 > // Scale = 1 (Default)
   > AnalogToUnsigned1; // TArduinoFloatToUnsigned
} // Types

namespace Instances
{
Types::AnalogToUnsigned1 AnalogToUnsigned1; // TArduinoFloatToUnsigned
} // Instances

namespace Types
{
typedef Mitov::MapRange<
  Mitov::ConstantProperty<5, bool, true >, // Enabled = True (Default)
  Mitov::NestedProperty<9, Mitov::ValueRange<
    Mitov::ConstantPropertyFloat<8, float, ::VisuinoConstants::FloatValue4 >, // Value_Max = 0.349999994039536
    Mitov::ConstantPropertyFloat<7, float, ::VisuinoConstants::FloatValue3 > // Value_Min = 0.150000005960464
     > >, // InputRange
  Mitov::AnalogPin_EmbeddedPinImplementation<3, ::PinCalls::PinCallerReceive4 >, // OutputPin
  Mitov::NestedProperty<13, Mitov::ValueRange<
    Mitov::ConstantPropertyFloat<12, float, ::VisuinoConstants::FloatValue6 >, // Value_Max = 100
    Mitov::ConstantPropertyFloat<11, float, ::VisuinoConstants::FloatValue5 > // Value_Min = -100
     > > // OutputRange
   > MapRange1; // TArduinoMapRange
} // Types

namespace Instances
{
Types::MapRange1 MapRange1; // TArduinoMapRange
} // Instances

namespace Types
{
typedef Mitov::CompareValue<
  Mitov::CompareType_Implementation_ctEqual, // CompareType = 0 (Default)
  Mitov::ConstantProperty<4, bool, true >, // Enabled = True (Default)
  Mitov::TypedVariable<9, bool, ::ComponentVariables::Variable4 >, // FStarted = 0
  Mitov::ConstantProperty<8, bool, true >, // OnlyChanged = True (Default)
  Mitov::DigitalPin_EmbeddedPinImplementation<5, ::PinCalls::PinCallerReceive5 >, // OutputPin
  int32_t, // TYPE
  Mitov::ConstantProperty<6, int32_t, 1 > // Value = 1
   > CompareValue1; // TArduinoIntegerCompareValue
} // Types

namespace Instances
{
Types::CompareValue1 CompareValue1 = Types::CompareValue1( 0 ); // TArduinoIntegerCompareValue
} // Instances

namespace Types
{
typedef Mitov::SRFlipFlop<
  Mitov::TypedVariableValue<5, bool, ::ComponentVariables::Variable5, false >, // InitialValue = False (Default)
  Mitov::DigitalPin_EmbeddedPinImplementation<4, ::PinCalls::PinCallerReceive7 >, // InvertedOutputPin
  Mitov::DigitalPin_EmbeddedPinImplementation<3, ::PinCalls::PinCallerReceive6 > // OutputPin
   > SRFlipFlop1; // TArduinoSRFlipFlop
} // Types

namespace Instances
{
Types::SRFlipFlop1 SRFlipFlop1; // TArduinoSRFlipFlop
} // Instances

namespace Types
{
typedef Mitov::PulseGenerator<
  Mitov::ConstantPropertyFloat<8, float, ::VisuinoConstants::FloatValue7 >, // Asymmetry = 0 (Default)
  Mitov::ConstantProperty<4, bool, true >, // Enabled = True (Default)
  Mitov::ConstantPropertyFloat<17, float, ::VisuinoConstants::FloatValue7>, // FPhase = 0
  Mitov::TypedVariable<15, bool, ::ComponentVariables::Variable6 >, // FValue = 0
  Mitov::ConstantPropertyFloat<7, float, ::VisuinoConstants::FloatValue3 >, // Frequency = 0.150000005960464
  Mitov::ConstantProperty<5, bool, false >, // InitialValue = False (Default)
  Mitov::DigitalPin_EmbeddedPinImplementation<3, ::PinCalls::PinCallerReceive8 >, // OutputPin
  Mitov::ConstantPropertyFloat<9, float, ::VisuinoConstants::FloatValue7 >, // Phase = 0 (Default)
  Mitov::NestedProperty<14, Mitov::TArduinoGeneratorWhenDisabled<
    Mitov::ConstantProperty<13, bool, false >, // CompleteCycle = False (Default)
    Mitov::ConstantProperty<12, bool, true >, // FCycleCompleted = True
    Mitov::ConstantProperty<11, bool, false > // Reset = False (Default)
     > > // WhenDisabled
   > PulseGenerator1; // TArduinoPulseGenerator
} // Types

namespace Instances
{
Types::PulseGenerator1 PulseGenerator1; // TArduinoPulseGenerator
} // Instances

namespace Types
{
typedef Mitov::PulseGenerator<
  Mitov::ConstantPropertyFloat<8, float, ::VisuinoConstants::FloatValue7 >, // Asymmetry = 0 (Default)
  Mitov::SharedVariableProperty<4, bool, true, ::ComponentVariables::Shared_bool_0 >, // Enabled = True (Default)
  Mitov::ConstantPropertyFloat<17, float, ::VisuinoConstants::FloatValue7>, // FPhase = 0
  Mitov::TypedVariable<15, bool, ::ComponentVariables::Variable8 >, // FValue = 0
  Mitov::ConstantPropertyFloat<7, float, ::VisuinoConstants::FloatValue8 >, // Frequency = 4
  Mitov::ConstantProperty<5, bool, false >, // InitialValue = False (Default)
  Mitov::DigitalPin_EmbeddedPinImplementation<3, ::PinCalls::PinCallerReceive9 >, // OutputPin
  Mitov::ConstantPropertyFloat<9, float, ::VisuinoConstants::FloatValue7 >, // Phase = 0 (Default)
  Mitov::NestedProperty<14, Mitov::TArduinoGeneratorWhenDisabled<
    Mitov::ConstantProperty<13, bool, false >, // CompleteCycle = False (Default)
    Mitov::ConstantProperty<12, bool, true >, // FCycleCompleted = True
    Mitov::ConstantProperty<11, bool, false > // Reset = False (Default)
     > > // WhenDisabled
   > PulseGenerator2; // TArduinoPulseGenerator
} // Types

namespace Instances
{
Types::PulseGenerator2 PulseGenerator2; // TArduinoPulseGenerator
} // Instances

namespace Types
{
typedef Mitov::CompareValue<
  Mitov::CompareType_Implementation_ctBigger, // CompareType = 2
  Mitov::ConstantProperty<4, bool, true >, // Enabled = True (Default)
  Mitov::TypedVariable<9, bool, ::ComponentVariables::Variable9 >, // FStarted = 0
  Mitov::ConstantProperty<8, bool, true >, // OnlyChanged = True (Default)
  Mitov::DigitalPin_EmbeddedPinImplementation<5, ::PinCalls::PinCallerReceive10 >, // OutputPin
  float, // TYPE
  Mitov::ConstantPropertyFloat<6, float, ::VisuinoConstants::FloatValue9 > // Value = 60
   > CompareValue2; // TArduinoCompareValue
} // Types

namespace Instances
{
Types::CompareValue2 CompareValue2 = Types::CompareValue2( 0.0f ); // TArduinoCompareValue
} // Instances

namespace Types
{
typedef Mitov::PlayFrequencyToneDurationState<
  Mitov::EmbeddedCallChain<CallChains::TryActive1 >, // Elements_TryActive
  Mitov::ConstantProperty<4, bool, true >, // Enabled = True (Default)
  Mitov::TypedVariable<8, bool, ::ComponentVariables::Variable10 >, // FPlaying = 0
  Mitov::VariablePropertyFloat<6, float, ::VisuinoConstants::FloatValue7 >, // InitialFrequency = 0 (Default)
  7 // OutputPin
   > PlayFrequency1; // TArduinoPlayFrequencyTone
} // Types

namespace Instances
{
Types::PlayFrequency1 PlayFrequency1; // TArduinoPlayFrequencyTone
} // Instances

namespace Types
{
typedef Mitov::PlayFrequencyToneStateSetValueElement<
  Declarations::Types::PlayFrequency1, // 0_TYPE_OWNER
  Declarations::Instances::PlayFrequency1, // 1_NAME_OWNER
  Mitov::ConstantProperty<3, uint32_t, 0 >, // Duration = 0 (Default)
  Mitov::TypedVariable<5, bool, ::ComponentVariables::Variable11 >, // FInputValue = 0
  Mitov::ConstantPropertyFloat<2, float, ::VisuinoConstants::FloatValue10 > // Frequency = 3000
   > TArduinoPlayFrequencyToneStateSetValueElement1;
} // Types

namespace Instances
{
Types::TArduinoPlayFrequencyToneStateSetValueElement1 TArduinoPlayFrequencyToneStateSetValueElement1;
} // Instances

namespace Types
{
typedef Mitov::BooleanInverter<
  Mitov::SharedVariableProperty<4, bool, true, ::ComponentVariables::Shared_bool_0 >, // Enabled = True (Default)
  Mitov::DigitalPin_DirectBoardPinImplementation<6 > // OutputPin
   > Inverter1; // TArduinoBooleanInverter
} // Types

namespace Instances
{
Types::Inverter1 Inverter1; // TArduinoBooleanInverter
} // Instances

namespace Types
{
typedef Mitov::PulseGenerator<
  Mitov::ConstantPropertyFloat<8, float, ::VisuinoConstants::FloatValue7 >, // Asymmetry = 0 (Default)
  Mitov::SharedVariableProperty<4, bool, true, ::ComponentVariables::Shared_bool_0 >, // Enabled = True (Default)
  Mitov::ConstantPropertyFloat<17, float, ::VisuinoConstants::FloatValue7>, // FPhase = 0
  Mitov::TypedVariable<15, bool, ::ComponentVariables::Variable12 >, // FValue = 0
  Mitov::ConstantPropertyFloat<7, float, ::VisuinoConstants::FloatValue11 >, // Frequency = 6
  Mitov::ConstantProperty<5, bool, false >, // InitialValue = False (Default)
  Mitov::DigitalPin_EmbeddedPinImplementation<3, ::PinCalls::PinCallerReceive11 >, // OutputPin
  Mitov::ConstantPropertyFloat<9, float, ::VisuinoConstants::FloatValue7 >, // Phase = 0 (Default)
  Mitov::NestedProperty<14, Mitov::TArduinoGeneratorWhenDisabled<
    Mitov::ConstantProperty<13, bool, false >, // CompleteCycle = False (Default)
    Mitov::ConstantProperty<12, bool, true >, // FCycleCompleted = True
    Mitov::ConstantProperty<11, bool, false > // Reset = False (Default)
     > > // WhenDisabled
   > PulseGenerator3; // TArduinoPulseGenerator
} // Types

namespace Instances
{
Types::PulseGenerator3 PulseGenerator3; // TArduinoPulseGenerator
} // Instances

namespace Types
{
typedef Mitov::CompareValue<
  Mitov::CompareType_Implementation_ctSmaller, // CompareType = 3
  Mitov::ConstantProperty<4, bool, true >, // Enabled = True (Default)
  Mitov::TypedVariable<9, bool, ::ComponentVariables::Variable13 >, // FStarted = 0
  Mitov::ConstantProperty<8, bool, true >, // OnlyChanged = True (Default)
  Mitov::DigitalPin_EmbeddedPinImplementation<5, ::PinCalls::PinCallerReceive12 >, // OutputPin
  float, // TYPE
  Mitov::ConstantPropertyFloat<6, float, ::VisuinoConstants::FloatValue12 > // Value = -65
   > CompareValue3; // TArduinoCompareValue
} // Types

namespace Instances
{
Types::CompareValue3 CompareValue3 = Types::CompareValue3( 0.0f ); // TArduinoCompareValue
} // Instances

} // Declarations

// Type Converters

namespace TypeConverters
{
Mitov::Convert_BinaryToClock<Mitov::TypedVariable<0, bool, ::ComponentVariables::Variable14 > > Converter0;
Mitov::Convert_BinaryToClock<Mitov::TypedVariable<0, bool, ::ComponentVariables::Variable15 > > Converter1;
Mitov::Convert_BinaryToClock<Mitov::TypedVariable<0, bool, ::ComponentVariables::Variable16 > > Converter2;
Mitov::Convert_BinaryToClock<Mitov::TypedVariable<0, bool, ::ComponentVariables::Variable17 > > Converter3;
Mitov::Convert_BinaryToClock<Mitov::TypedVariable<0, bool, ::ComponentVariables::Variable18 > > Converter4;
Mitov::Convert_BinaryToClock<Mitov::TypedVariable<0, bool, ::ComponentVariables::Variable19 > > Converter5;
} // TypeConverters

// Bindings

namespace Bindings
{
inline void PulseGenerator2_EnabledInputPin_o_Receive( void * ___PTR___, bool __AOriginalValue__ )
{
  bool ___A_VALUE___ = *(bool *)___PTR___;
  if( __AOriginalValue__ == ___A_VALUE___ )
    return;

  Declarations::Instances::PulseGenerator2.Enabled() = ___A_VALUE___;
  Declarations::Instances::PulseGenerator2.UpdateEnabled();
}

inline void PulseGenerator3_EnabledInputPin_o_Receive( void * ___PTR___, bool __AOriginalValue__ )
{
  bool ___A_VALUE___ = *(bool *)___PTR___;
  if( __AOriginalValue__ == ___A_VALUE___ )
    return;

  Declarations::Instances::PulseGenerator3.Enabled() = ___A_VALUE___;
  Declarations::Instances::PulseGenerator3.UpdateEnabled();
}

} // Bindings

// Call Chains

namespace CallChains
{
void SendByte1::Call( uint8_t AValue )
{
  BoardDeclarations::Instances::TArduinoI2C1.SendByte( AValue );
}

void RequestData1::Call()
{
  BoardDeclarations::Instances::TArduinoI2C1.RequestData();
}

void Render1::Call()
{
}

void PeriodicCall1::Call()
{
  Declarations::Instances::ClockGenerator1.PeriodicCall();
}

void TryActive1::Call( bool & AResult )
{
  Declarations::Instances::TArduinoPlayFrequencyToneStateSetValueElement1.TryActive( AResult );
}

} // CallChains

// Pin Call Declarations

namespace PinCalls
{
void PinCallerConverterReceive1( void *_Data );
void PinCallerConverterReceive2( void *_Data );
void PinCallerConverterReceive3( void *_Data );
void PinCallerConverterReceive4( void *_Data );
void PinCallerConverterReceive5( void *_Data );
void PinCallerConverterReceive6( void *_Data );
} // PinCalls

// Pin Call Implementations

namespace PinCalls
{
void PinCallerReceive0::Notify( void *_Data )
{
  Declarations::Instances::MapRange1.InputPin_o_Receive( _Data );
}

void PinCallerReceive1::Notify( void *_Data )
{
  Declarations::Instances::UpDownCounter1.UpInputPin_o_Receive( _Data );
}

void PinCallerReceive2::Notify( void *_Data )
{
  Declarations::Instances::TArduinoMonochromeGraphicsDrawLine1.X().InputPin_o_Receive( _Data );
  Declarations::Instances::TArduinoMonochromeGraphicsDrawLine1.ClockInputPin_o_Receive( _Data );
  Declarations::Instances::CompareValue1.InputPin_o_Receive( _Data );
}

void PinCallerReceive3::Notify( void *_Data )
{
  Declarations::Instances::TArduinoMonochromeGraphicsDrawLine1.Height().InputPin_o_Receive( _Data );
}

void PinCallerReceive4::Notify( void *_Data )
{
  Declarations::Instances::AnalogToUnsigned1.InputPin_o_Receive( _Data );
  Declarations::Instances::CompareValue2.InputPin_o_Receive( _Data );
  Declarations::Instances::CompareValue3.InputPin_o_Receive( _Data );
}

void PinCallerReceive5::Notify( void *_Data )
{
  TypeConverters::Converter0.Convert( _Data, PinCallerConverterReceive1 );
}

void PinCallerConverterReceive1( void *_Data )
{
  Declarations::Instances::TArduinoMonochromeGraphicsElementFillScreen1.ClockInputPin_o_Receive( _Data );
}
void PinCallerReceive6::Notify( void *_Data )
{
  bool __Value_PulseGenerator2_EnabledInputPin__ = Declarations::Instances::PulseGenerator2.Enabled().GetValue();
  bool __Value_PulseGenerator3_EnabledInputPin__ = Declarations::Instances::PulseGenerator3.Enabled().GetValue();
  ::Bindings::PulseGenerator2_EnabledInputPin_o_Receive( _Data, __Value_PulseGenerator2_EnabledInputPin__ );
  Declarations::Instances::Inverter1.Enabled().InputPin_o_Receive( _Data );
  ::Bindings::PulseGenerator3_EnabledInputPin_o_Receive( _Data, __Value_PulseGenerator3_EnabledInputPin__ );
}

void PinCallerReceive7::Notify( void *_Data )
{
  TypeConverters::Converter1.Convert( _Data, PinCallerConverterReceive2 );
}

void PinCallerConverterReceive2( void *_Data )
{
  Declarations::Instances::PulseGenerator1.ResetInputPin_o_Receive( _Data );
  Declarations::Instances::PulseGenerator2.ResetInputPin_o_Receive( _Data );
  Declarations::Instances::PulseGenerator3.ResetInputPin_o_Receive( _Data );
}
void PinCallerReceive8::Notify( void *_Data )
{
  TypeConverters::Converter2.Convert( _Data, PinCallerConverterReceive3 );
}

void PinCallerConverterReceive3( void *_Data )
{
  Declarations::Instances::SRFlipFlop1.ResetInputPin_o_Receive( _Data );
}
void PinCallerReceive9::Notify( void *_Data )
{
  Declarations::Instances::TArduinoMonochromeGraphicsElementDrawText1.Enabled().InputPin_o_Receive( _Data );
  TypeConverters::Converter3.Convert( _Data, PinCallerConverterReceive4 );
  Declarations::Instances::TArduinoPlayFrequencyToneStateSetValueElement1.InputPin_o_Receive( _Data );
}

void PinCallerConverterReceive4( void *_Data )
{
  Declarations::Instances::TArduinoMonochromeGraphicsElementDrawText1.ClockInputPin_o_Receive( _Data );
}
void PinCallerReceive10::Notify( void *_Data )
{
  TypeConverters::Converter4.Convert( _Data, PinCallerConverterReceive5 );
}

void PinCallerConverterReceive5( void *_Data )
{
  Declarations::Instances::SRFlipFlop1.SetInputPin_o_Receive( _Data );
}
void PinCallerReceive11::Notify( void *_Data )
{
  Declarations::Instances::Inverter1.InputPin_o_Receive( _Data );
  BoardDeclarations::Instances::ArduinoDigitalChannel_4.DigitalInputPin_o_Receive( _Data );
}

void PinCallerReceive12::Notify( void *_Data )
{
  TypeConverters::Converter5.Convert( _Data, PinCallerConverterReceive6 );
}

void PinCallerConverterReceive6( void *_Data )
{
  Declarations::Instances::SRFlipFlop1.SetInputPin_o_Receive( _Data );
}
} // PinCalls

namespace ComponentsHardware
{
void SystemUpdateHardware()
{
}
} // ComponentsHardware

//The setup function is called once at startup of the sketch
void setup()
{
  BoardDeclarations::SystemPeriodMicros_142858.SystemStarted();
  BoardDeclarations::Instances::TArduinoI2C1.SystemInit();
  BoardDeclarations::Instances::ArduinoDigitalChannel_4.SystemInit();
  BoardDeclarations::Instances::ArduinoAnalogInputChannel_0.SystemInit();
  Declarations::Instances::DisplayOLED1.SystemInit();
  Declarations::Instances::UpDownCounter1.SystemInit();
  BoardDeclarations::Instances::ArduinoDigitalChannel_4.SystemStart();
  BoardDeclarations::Instances::ArduinoAnalogInputChannel_0.SystemStart();
  Declarations::Instances::DisplayOLED1.SystemStart();
  Declarations::Instances::ClockGenerator1.SystemStart();
  Declarations::Instances::UpDownCounter1.SystemStart();
  Declarations::Instances::CompareValue1.SystemStart();
  Declarations::Instances::SRFlipFlop1.SystemStart();
  Declarations::Instances::PulseGenerator1.SystemStart();
  Declarations::Instances::PulseGenerator2.SystemStart();
  Declarations::Instances::CompareValue2.SystemStart();
  Declarations::Instances::PlayFrequency1.SystemStart();
  Declarations::Instances::PulseGenerator3.SystemStart();
  Declarations::Instances::CompareValue3.SystemStart();
}

// The loop function is called in an endless loop
void loop()
{
  BoardDeclarations::SystemPeriodMicros_142858.SystemLoopBegin();
  BoardDeclarations::Instances::ArduinoDigitalChannel_4.SystemLoopBegin();
  BoardDeclarations::Instances::ArduinoAnalogInputChannel_0.SystemLoopBegin();
  Declarations::Instances::ClockGenerator1.SystemLoopBegin();
  Declarations::Instances::PulseGenerator1.SystemLoopBegin();
  Declarations::Instances::PulseGenerator2.SystemLoopBegin();
  Declarations::Instances::PlayFrequency1.SystemLoopBegin();
  Declarations::Instances::PulseGenerator3.SystemLoopBegin();
  Declarations::Instances::DisplayOLED1.SystemLoopEnd();
}
