Download the I2C libraries cd ~ git clone https://github.com/adafruit/Adafruit_Python_PCA9685 git clone https://github.com/adafruit/Adafruit_Python_LSM303 git clone https://github.com/adafruit/Adafruit_Python_ADXL345 Install the libraries cd ~/Adafruit_Python_PCA9685 sudo python setup.py install sudo python3 setup.py install cd ~/Adafruit_Python_LSM303 sudo python setup.py install sudo python3 setup.py install cd ~/Adafruit_Python_ADXL345 sudo python setup.py install sudo python3 setup.py install Test the LSM303 cd ~/Adafruit_Python_LSM303/examples chmod a+x simpletest.py sudo python simpletest.py or test the ADXL345 cd ~/Adafruit_Python_ADXL345/examples chmod a+x simpletest.py sudo python simpletest.py Test the PCA9685 for LED ** Connect PCA9685 pin V+ to 3.3v (REMOVE THIS LATER) ** Connect PCA9685 pin 15 --> LED --> resistor --> GND cd ~/Adafruit_Python_PCA9685/examples python3 >>> import Adafruit_PCA9685 >>> pcadev = Adafruit_PCA9685.PCA9685() >>> pcadev.set_pwm(15, 0, 0) >>> pcadev.set_pwm(15, 0, 4005) Test the PCA9685 for Servo ** Disconnect the cobbler ** Connect PCA9685 pin V+ to 5V connection on (This may not be enough ...) ** Connect PCA9685 servo connnection at 12 to server (Be sure to get it right) ** Read http://www.robotplatform.com/knowledge/servo/servo_tutorial.html ** Pulse every 20 msec (1/50 sec) ** Pulse width from 1 msec to 2 msec ** 4096/20 ~~ 200 and 4096/10 ~~ 400 ** example program suggests 150 to 600 ** we will test it! ** If Raspberry Pi stops working, we will need battery packs! cd ~/Adafruit_Python_PCA9685/examples python3 >>> import Adafruit_PCA9685 >>> pcadev = Adafruit_PCA9685.PCA9685() >>> pcadev.set_pwm_freq(50) >>> pcadev.set_pwm(12, 0, 600) experiment to you see the limits Try out the level software *** It's in this directory at levelit.py *** Think of some way to modify it... Install web server (should be already done) sudo apt-get -y install lighttpd ** Load page to test -- http://uncacsci-pi-X.cs.unca.edu sudo chown www-data:www-data /var/www/html sudo chmod 775 /var/www/html sudo adduser YOURLOGIN www-data ** log in and out Install CGI stuff (This can be difficult) *** You must modify /etc/lighttpd/lighttpd.conf *** This can be hard.... Follow me *** Save the old /etc/lighttpd/lighttpd.conf cp /etc/lighttpd/lighttpd.conf ~ *** Download the new lighttpd.conf from this directory *** replace present lighttpd.conf cp ~/Downloads/lighttpd.conf /etc/lighttpd *** Check out the differences diff /etc/lighttpd/lighttpd.conf ~/lighttpd.conf *** add www-data to needed groups sudo adduser www-data gpio sudo adduser www-data i2c *** restart lighttpd sudo service lighttpd restart Test CGI stuff ** create testit directory... cd /var/www/html mkdir testit cd testit *** Download the test.cgi from this directory *** Copy into testit directory cp ~/Downloads/test.cgi . *** make sure it is exectable chmod a+x test.cgi ./test.cgi *** Try to load it remotely http://www.uncacsci-pi-X.cs.unca.edu/testit/test.cgi Test I2C CGI stuff *** Download listi2c.cgi from this directory *** Copy into this directory cp ~/Downloads/listi2c.cgi . chmod a+x listi2c.cgi ./listi2c.cgi *** Try to load remotely http://www.uncacsci-pi-X.cs.unca.edu/testit/listi2c.cgi Test I2C devices *** Repeat above for acctest.cgi, ledon.cgi, ledoff.cgi