This is the vcdMaker demo project. See http://vcdmaker.org for details. vcdMaker is supposed to help engineers to debug their applications and systems. It transforms text log files into the VCD format which can be easily displayed as a waveform.

Dependencies:   mbed vcdLogger vcdSignal

Signals/button.cpp

Committer:
ketjow
Date:
2016-02-12
Revision:
0:9a59cffaafad
Child:
1:446154224f92

File content as of revision 0:9a59cffaafad:

  #include "button.hpp"
  
  Button::Button(const string& name, const PinName pin, Logger& logger) : DigitalIn(pin), Signal(name,1,logger)
  {
  }
    
  void Button::PrintState()
  {
    string  suffix("");
    int32_t time_ref = 0;
    if (read())
    {
      string msg("Key released");
      PrintVector(0, suffix, msg, time_ref);
    }
    else
    {
      string msg("Key pressed");
      PrintVector(1, suffix, msg, time_ref);
    }
  }