I tried to set a static ip using the method below, but it didn't work. So on reboot I changed the settings back, disabled networking and reenabled dhcpcd but now I don't get any ip. Can anyone help??
Network Interfaces method
Configure a static network adddress on your Pi in /etc/network/interfaces
iface eth0 inet static
iface wlan0 inet static
address is the address from the command above (or another unused address on the same network), netmask 255.255.255.0 corresponds to network size/24. gateway is the address of your router (or gateway).
You can also specify dns-nameservers, but this is generally not necessary. The broadcast is automatically derived from address and netmask and need not be specified. For more detail see https://wiki.debian.org/NetworkConfiguration
You can set either or both eth0 or wlan0
Then disable the DHCP client daemon and switch to standard Debian networking:
sudo systemctl disable dhcpcd
sudo systemctl enable networking
Reboot for the changes to take effect: