A digital lab notebook. Topics range from scientific computing using Python to neurobiology of Drosophila.
Thursday, August 23, 2012
Arduino control of polarization switcher
Here is the code that I used in the Arduino box to control the polarization rotator (switcher). (I think...)
Setting up Simple Step
These are my notes on setting up Simple Step, a program by Will Dickson for controlling stepper motors.
Using synaptic, install gcc-avr, avr-libc, and dfu-programmer.
Download MyUSB v 1.4.1 from http://www.fourwalledcubicle.com/LUFA.php and extract it to MyUSB
Change line 24 to
Exit gedit
Change line 53 to
Press the 'RST' and 'HWB' buttons on the atmel simultaneously, then release the 'RST' button, then the 'HWB' button.
Reboot
Install pylibusb
Using synaptic, install gcc-avr, avr-libc, and dfu-programmer.
cd src
mkdir MyUSB
cd MyUSBDownload MyUSB v 1.4.1 from http://www.fourwalledcubicle.com/LUFA.php and extract it to MyUSB
make all
cd ~/src
hg clone https://bitbucket.org/willdickson/simple_step
cd simple_step/firmware
gedit MakefileChange line 24 to
MYUSB_SRC_DIR = /home/<username>/src/MyUSB/MyUSBExit gedit
cd src
gedit MakefileChange line 53 to
MYUSB_SRC_DIR = /home/<username>/src/MyUSB/MyUSB
cd ..
make
cd ~/src/simple_step/firmwarePress the 'RST' and 'HWB' buttons on the atmel simultaneously, then release the 'RST' button, then the 'HWB' button.
sudo make program
cd ~/src/simple_step/firmware
sudo cp udev_rules/99-simple_step.rules /etc/udev/rules.d
sudo addgroup simple-step
sudo usermod -a -G simple-step <username>Reboot
Install pylibusb
cd simple_step/api/python
sudo python setup.py install
Setting up Python PControl
These are my notes on setting up Python PControl:
Install mercurial via synaptic
Install mercurial via synaptic
cd src
hg clone https://bitbucket.org/willdickson/panel_comm
cd panel_comm
sudo python setup.py install
Setting up Arduino in Ubuntu
These are my notes from setting up Arduino in Ubuntu Lucid 10.04:
Download newest release from http://arduino.cc/en/Main/Software and extract it to a convenient location.
Double clicking on the arduino file should start the program.
BEWARE: Serial.println in a loop can cause entire Java Arduino program to lock up because it locks up the serial ports, which are scanned every time you click the tools menu (upload a different sketch using windows or mac to fix the problem)
sudo apt-get install gcc-avr avr-libc
Download newest release from http://arduino.cc/en/Main/Software and extract it to a convenient location.
Double clicking on the arduino file should start the program.
sudo usermod -aG dialout <myuser>BEWARE: Serial.println in a loop can cause entire Java Arduino program to lock up because it locks up the serial ports, which are scanned every time you click the tools menu (upload a different sketch using windows or mac to fix the problem)
Tuesday, August 21, 2012
Subscribe to:
Posts (Atom)
