I am working with a 16K25K22 to use the servo master lib.. I have a nice
picture on my scope but no reaction on the servo's. Please help.
regards
hans
--------------------------------------
include 18F25K22
pragma target clock 32_000_000 -- Fosc
pragma target OSC INTOSC_NOCLKOUT
pragma target PLLEN disabled -- software controlled!
pragma target PCLKEN enabled
pragma target FCMEN disabled
pragma target IESO disabled
pragma target PWRTE enabled
pragma target BROWNOUT disabled
pragma target WDT disabled
pragma target PBADEN digital
pragma target MCLR external
pragma target LVP disabled
pragma target XINST disabled
pragma target DEBUG disabled
OSCCON_IRCF = 0b110 -- 8 MHz
OSCCON_SCS = 0 -- clock selected by fuses
OSCTUNE_PLLEN = 1 -- 8 -> 32 MHz with INTOSC
enable_digital_io()
include delay
-- setup USART 1 to dfplayer
const serial_hw_baudrate = 9600
const bit serial_overflow_discard = false -- do not allow xmit buffer
overflow
include serial_hardware
serial_hw_init()
-- setup USART 2 (terminal side)
--const serial_hw2_baudrate =9600
--const bit serial2_overflow_discard = false -- do not allow xmit
buffer overflow
--include serial_hardware2
--serial_hw2_init()
var bit RCT = low
include dfplayer
dfplayer_init()
--------------------------------------------------------------
var bit random_downgrade = false
include random
-------------------------------------------------------------------------------------------
-- setup servo pins
alias servo_1 is pin_A0 --------- oog rechts
alias servo_1_direction is pin_A0_direction
servo_1_direction = output
--
alias servo_2 is pin_A1 ---------- oog links
alias servo_2_direction is pin_A1_direction
servo_2_direction = output
--
alias servo_3 is pin_A2 -------- hoofd L?R
alias servo_3_direction is pin_A2_direction
servo_3_direction = output
--
alias servo_4 is pin_A3 ---------- hoofd op/neer
alias servo_4_direction is pin_A3_direction
servo_4_direction = output
--
alias servo_5 is pin_A5 --------- onder arm L
alias servo_5_direction is pin_A5_direction
servo_5_direction = output
--
alias servo_6 is pin_C0 ---------- boven arm L
alias servo_6_direction is pin_C0_direction
servo_6_direction = output
--
alias servo_7 is pin_C1 ---------- schouder L
alias servo_7_direction is pin_C1_direction
servo_7_direction = output
--
alias servo_8 is pin_C2 ---------- hand
alias servo_8_direction is pin_C2_direction
servo_8_direction = output
--
alias motor is pin_C4 -- is de aansturing van de draai
alias motor_direction is pin_C4_direction
motor_direction = output
motor = low
--
alias spraak is pin_B2 --- actief low naar spraak print
alias spraak_direction is pin_B2_direction
spraak_direction = output
spraak = HIGH
-- choose min & max servo movment / pulse size
const byte SERVO_MIN = 50 -- default is 50 (0.5ms min pulse)
const byte SERVO_MAX = 255 -- default is 255 (2.5ms max pulse)
-- choose pic internal timers
const byte SERVO_USE_TIMER = 0 -- timer for servo's 1 to 8
const byte SERVO_9_TO_16_USE_TIMER = 1 -- timer for servo's 9 to 16
;const byte SERVO_17_TO_24_USE_TIMER = 3 -- timer for servo's 17 to 24
include servo_rc_master -- include the servo library
servo_init()
-- basic position all servo's -aangepast 26/09
servo_move(118,1)
servo_move(142,2)
servo_move(109,3)
servo_move(39,4)
servo_move(80,5)
servo_move(146,6)
servo_move(93,7)
servo_move(157,8)
--
You received this message because you are subscribed to the Google Groups
"jallib" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jallib/81f1e67e-fb4d-46d6-88ba-69071143087cn%40googlegroups.com.