The examples given here are for modifying the wlan0 interface. Replace wlan0 with the interface you are configuring. i.e. (eth0,wlan1)
This was the typical way to add a static IP address to a Pi, if you have issues with this, then try Method 2.
sudo vi /etc/network/interfaces
In the file it is pretty easy to see which lines control which interface, find the lines that control wlan0 (or the interface your configuring) and change/add to look like below.
iface wlan0 inet static
Save the file, reboot, and the Pi should come up with the new static IP.
It looks like on the newer versions of Raspbian, the above method does not work anymore, so now you have to edit the following file
sudo vi /etc/dhcpcd.conf
and add the following lines.
If you just need to assign a static IP address, to the device, because it is going to be setup as a hotspot or something, you can get away with the following.
If you run into issues with it not assigning the address, check the /etc/network/interfaces file and make sure that the line that starts with “iface wlan0” says manual at the end and not static. If it says “iface wlan0 inet static”, change it to “iface wlan0 inet manual”