A static IP is invaluable to many projects due to the fact that you can search up the local IP of your Pi even after rebooting as it will stay the same. The covert camera is a really cool project that makes a use of this.
Now, this project is best done when you have just downloaded the OS onto your SD card for your Pi. Some projects else where on the internet may ask you to make changes to the /etc/network/interfaces folder which could mess things up for us.
NOTE: You only need the Wifi adapter if Wifi is not built into your Pi
1. Edit the file holding the data about your IP addresses
$ - sudo nano /etc/dhcpcd.conf
2. Next, scroll to the bottom of the file and add the following code:
3. There are two static IP addresses - one (eth0) for an Ethernet connection and the other (wlan0) for a Wifi connection. You can change the 4th number in the "static ip_address" to something of your choice such as 10. But make sure it is in the format 192.168.0.x/24, x being your chosen number.
4. Hit Ctrl+x then Y to save all the changes
5. Reboot the Pi:
$ - sudo reboot
6. Check the IP address is what you set it to be by executing the following command:
$ - ifconfig