sketch_unittest.cc File
This file contains two templates.
Template 1 - When using general components This template is used in situations where the code should execute regardless of the conditions.
Example 1) Is the input/output of pin 13 configured correctly?
Example 2) Is the serial communication value set to 9600 correctly?
Template 2 - When receiving input values from sensors This template is used in situations where the execution result varies depending on the conditions.
Example 1) Is the LED properly turned on when the measurement value of the motion sensor is HIGH?
Example 2) Is the sound of the piezo buzzer properly played when the measurement value of the ultrasonic sensor is 17cm?
ℹ️ You can copy and paste the templates as needed to set multiple grading criteria. However, you should appropriately modify the numbers in the test suite (quiz1
) to quiz1
, quiz2
, etc.
Template 1 - When using general components
① Section - Write the code that you want to check for execution, excluding the semicolon (
;
). ② Section - Write the minimum number of times the code should be executed.
⚠️ If you need to check the serial communication-related code, write only the necessary code excluding the Serial.
part.
Set
setup();
orloop();
depending on the area where grading should be performed.If you want to check the code in the setup() function. → Keep only
setup();
and deleteloop();
If you want to check the code in the loop() function. → Keep only
loop();
and deletesetup();
⚠️ You cannot check the code in both the setup() and loop() functions simultaneously. You need to divide them into separate test cases, as shown in the example below.
Template 2 - When receiving input values from sensors
① Section - Write the code that the sensor uses to measure values, excluding the semicolon (
;
). ② Section - Write the assumed value that the sensor measures.
① Section - Write the code that you want to check for execution, excluding the semicolon (
;
). ② Section - Write the minimum number of times the code should be executed.
⚠️ If you need to check the serial communication-related code, write only the necessary code excluding the Serial.
part.
Last updated