Adding a PIC microprocessor
I intend to use i2c to control the PIC as i2c slave - so far only i2c write is working but that is all I need for the following
Control two model servo motors to move a webcam around two axes (nod and rotate)
I modified the code created by the author of this site (with thanks!)
My backup copies are -
For the Bifferboard
Bifferboard_PIC_demo.c
Bifferboard_PIC_demo (compiled)
For the PIC
slug_i2c_pic16f690b.c
slug_i2c_pic16f690b (compiled)
drive like -
Bifferboard_PIC_demo 8 10 1000
where 8 is the i2c address (seen in i2cdetect 0)
10 requests servo 1
1000 is the (16 bit) servo rotation setting - 80 to 1800 gives the full range of my Hitec servo
The settings in the program are modified (by try and see) to match the servo chosen
16F690 connections
Pin 11 port B6 SCL
Pin 13 port B4 SDA
Pin 14 port C2 Servo 1
Pin 15 port C1 Servo 2
Pin 16 port C0 Servo power control (not yet used - a transistor will be needed to switch the power)
(The 5V to 3.3V level converter is like the top part of this )