Your methods to debug code and circuit

Posted on
  • When I programming in JavaScript for Web pages there are tools (firebug or chrome dev tools) to debug the code. Is there a possibility in Espruino IDE to debug the code and circuits, and what are your methods?

  • On the electrical side, I often use a cheap digital storage scope to scout out signals. Even hand-held ones like the HPS140 or DSO Nano are a lot better than nothing. There are also some pretty cool USB devices now line the Analog Discovery.

    Sometimes I also just attach LEDs to signal wires so I can get some idea what they're doing.

    For debugging the software, I use the left-hand terminal. I can look at what values are set to just by typing the name of the variable, and I often change functions so that they print out what they're doing or blink LEDs when they're running.

    There's no single-stepping yet I'm afraid - but that's something that is on my list of stuff to do eventually! I tend to just type the name of individual functions or commands one by one in order to test out that they're doing what I expect.

  • Wow, those are amazing tools, it makes the "creation" more profitable and interesting.
    About the terminal, do we can check the analog signal power?

  • I'm not sure I understand your question? If you just want to read a voltage, you can type analogRead(A0) (for instance) and it'll display that voltage value.

  • Yes, analogRead(A0) that what I need. Thank you

  • Note that analogRead() returns a number between 0 and 1. To convert that to the voltage, multiply it by E.getAnalogVRef().

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Your methods to debug code and circuit

Posted by Avatar for Pumych @Pumych

Actions