How can I unit test Arduino code?

后端 未结 20 815
情深已故
情深已故 2020-12-07 06:53

I\'d like to be able to unit test my Arduino code. Ideally, I would be able to run any tests without having to upload the code to the Arduino. What tools or libraries can he

20条回答
  •  情书的邮戳
    2020-12-07 07:24

    In basic Arduino is written with C and C++, even libraries of arduino are written in C and C++. So,in simple terms just handle the code as C and C++ and try doing the unit testing. Here, by the word "handle" I mean you to change all the basic syntax like serial.println to sysout, pinmode to varaibles, void loop to while() loop which breaks either in keystock or after some iteration.

    I know this is little a long process and not so straight forward.On my personal experience, once you get to do with it, this turns to be more reliable.

    -Nandha_Frost

提交回复
热议问题