Skip to content

Commit

Permalink
search for C files indep of pythonpath
Browse files Browse the repository at this point in the history
  • Loading branch information
FilipDominec committed Apr 5, 2024
1 parent a99327c commit e15594d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions example_pwm.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@

# optimum settings to control a small servo (190 Hz)
# typically the timing range is 0.8 .. 2.2 ms pulse width, but YMMV
gpio = 0
rp.pwm_configure_pair(gpio=gpio, wrap_value=65535, clkdiv=20, clkdiv_int_frac=0)

rp.pwm_configure_pair(gpio=14, wrap_value=65535, clkdiv=50, clkdiv_int_frac=0)
#rp.pwm_set_value(gpio=14, value=65534) # minimum position
rp.pwm_set_value(gpio=14, value=0) # minimum position

gpio = 15
rp.pwm_configure_pair(gpio=gpio, wrap_value=65535, clkdiv=50, clkdiv_int_frac=0)
rp.pwm_set_value(gpio=gpio, value=100) # minimum position
time.sleep(1)
rp.pwm_set_value(gpio=gpio, value=27500) # maximum position


2 changes: 1 addition & 1 deletion rp2daq.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ int main() { // CPU core0 can be fully occupied with USB communication
bi_decl(bi_program_url("https://github.com/FilipDominec/rp2daq"));
bi_decl(bi_1pin_with_name(PICO_DEFAULT_LED_PIN, "Diagnostic LED, other pins assigned run-time"));

set_sys_clock_khz(250000, false); // reasonable overclock with safe margin
//set_sys_clock_khz(250000, false); // reasonable overclock with safe margin
// TODO check freq accuracy, set 'true' ? Seems a bit off, us_timer ticking 1% faster.
stdio_set_translate_crlf(&stdio_usb, false); // crucial for correct binary data transmission
stdio_init_all();
Expand Down

0 comments on commit e15594d

Please sign in to comment.