Python Frequency Generator | |
File Size: | 1 kb |
File Type: | py |
Frequency Generator is a python script that generates frequencies on the Raspberry Pi's GPIO pins. The default pin in number 18 on the board.This code does not use the pin nomenclature of the chip but instead the pin nomenclature of the board. If you have no idea what i'm talking aboutthen head to YouTube and look up Raspberry Pi IV Beginners. I also recommend the tutorials offered by adafruit.
This script runs solely on the Raspberry Pi. It requires python version 3.2.3 not 2.7.3. The script makes use of the GPIO pins so you must be running it as root. Instructions on how to do that will be provided. The RPi.GPIO module is used and it can be downloaded (see adafruit tutorials for help).
Note: Linux is not a Real Time Operating System (RTOS). Meaning that the signals generated by this script may not be exact and the timing as well. For this reason I do not suggest using this script to generate signals where precision is necessary. If you need exact timing buy an arduino.
Steps to run script in LXDE environment
This script runs solely on the Raspberry Pi. It requires python version 3.2.3 not 2.7.3. The script makes use of the GPIO pins so you must be running it as root. Instructions on how to do that will be provided. The RPi.GPIO module is used and it can be downloaded (see adafruit tutorials for help).
Note: Linux is not a Real Time Operating System (RTOS). Meaning that the signals generated by this script may not be exact and the timing as well. For this reason I do not suggest using this script to generate signals where precision is necessary. If you need exact timing buy an arduino.
Steps to run script in LXDE environment
- Open LXTerminal
- Enter the command "sudo idle3"
- Do file open and locate the scipt
- Under tab 'Run' select "Run Module"
- When the prompt, "what do you want to do", appears you may type in start, stop, or help.
- Pressing start will prompt you for a frequency in hertz. All rational numbers are valid input.
- It will prompt you for a length of time to generate the frequency for. You can put decimals in but it will use the nearest lower integer
- It will output the frequency as specified and prompt you for what to do next.
- Stop will exit the program
- Help will display a link to this website