After many mistakes I finally managed to get this working with my Antminer U2. If anyone else is trying this then this is what i did to get it to work(If you have a different device it might be different but Antminers should be very close if not the same):
[SSH to rasberry pi]
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install libusb-1.0-0-dev libusb-1.0-0 libcurl4-openssl-dev libncurses5-dev libudev-dev libtool automake pkg-config libjansson-dev tmux
cd
sudo git clone
https://github.com/ckolivas/cgminer.gitcd cgminer
sudo ./autogen.sh
./configure --enable-icarus
sudo make
sudo make install
tmux
cd
cd cgminer
cgminer
[Enter pool url]
[Enter pool username.workername]
[Enter password]
If you encounter any errors tell me and i can try and help.