diff options
author | Guy Shapira <gayuha@gmail.com> | 2020-09-14 10:36:41 +0300 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2020-09-26 20:26:44 -0400 |
commit | a79c57ab298eca18ef9b0d363e782c708968ffcb (patch) | |
tree | 1380e8792086a90241748b901abb86968bc369d6 /test/klippy | |
parent | 04f9f1b44e5f2d9fa35bb4fbb5e25791412dafcf (diff) | |
download | kutter-a79c57ab298eca18ef9b0d363e782c708968ffcb.tar.gz kutter-a79c57ab298eca18ef9b0d363e782c708968ffcb.tar.xz kutter-a79c57ab298eca18ef9b0d363e782c708968ffcb.zip |
test: Add pwm tests
Signed-off-by: Guy Shapira <gayuha@gmail.com>
Diffstat (limited to 'test/klippy')
-rw-r--r-- | test/klippy/pwm.cfg | 23 | ||||
-rw-r--r-- | test/klippy/pwm.test | 30 |
2 files changed, 53 insertions, 0 deletions
diff --git a/test/klippy/pwm.cfg b/test/klippy/pwm.cfg new file mode 100644 index 00000000..43bbd181 --- /dev/null +++ b/test/klippy/pwm.cfg @@ -0,0 +1,23 @@ +[output_pin soft_pwm_pin] +pin: ar8 +pwm: True +value: 0 +shutdown_value: 0 +cycle_time: 0.01 + +[output_pin hard_pwm_pin] +pin: ar9 +pwm: True +hardware_pwm: True +value: 0 +shutdown_value: 0 +cycle_time: 0.01 + +[mcu] +serial: /dev/ttyACM0 +pin_map: arduino + +[printer] +kinematics: none +max_velocity: 300 +max_accel: 3000 diff --git a/test/klippy/pwm.test b/test/klippy/pwm.test new file mode 100644 index 00000000..d204cbc6 --- /dev/null +++ b/test/klippy/pwm.test @@ -0,0 +1,30 @@ +# Test case for pwm +CONFIG pwm.cfg +DICTIONARY atmega2560.dict + +# Hard PWM +# Basic test +SET_PIN PIN=hard_pwm_pin VALUE=0 +SET_PIN PIN=hard_pwm_pin VALUE=0.5 +SET_PIN PIN=hard_pwm_pin VALUE=0.5 +SET_PIN PIN=hard_pwm_pin VALUE=0.25 +SET_PIN PIN=hard_pwm_pin VALUE=1 + +# Soft PWM +# Test basic on off +SET_PIN PIN=soft_pwm_pin VALUE=0 +SET_PIN PIN=soft_pwm_pin VALUE=0.5 +SET_PIN PIN=soft_pwm_pin VALUE=1 + +# Test cycle time +SET_PIN PIN=soft_pwm_pin VALUE=0 CYCLE_TIME=0.1 +SET_PIN PIN=soft_pwm_pin VALUE=1 CYCLE_TIME=0.5 +SET_PIN PIN=soft_pwm_pin VALUE=0.5 CYCLE_TIME=0.001 +SET_PIN PIN=soft_pwm_pin VALUE=0.75 CYCLE_TIME=0.01 +SET_PIN PIN=soft_pwm_pin VALUE=0.5 CYCLE_TIME=1 + +# Test duplicate values +SET_PIN PIN=soft_pwm_pin VALUE=0.5 CYCLE_TIME=0.5 +SET_PIN PIN=soft_pwm_pin VALUE=0.5 CYCLE_TIME=0.5 +SET_PIN PIN=soft_pwm_pin VALUE=0.75 CYCLE_TIME=0.5 +SET_PIN PIN=soft_pwm_pin VALUE=0.75 CYCLE_TIME=0.75 |