Computers are the backbone of today's world. A lot of functions are being executed on computer systems which cause too much load on CPU. Imagine how wonderful it would be if the computer tell us that it is under stress. It is possible we can achieve this using Bolt.
- Plug in the Buzzer in Breadboard.
- Connect the positive terminal (longer leg) of the buzzer to the '1' pin of the Bolt device.
- Now connect negative terminal (shorter leg) to the '2' pin of the Bolt device.
- Connect the usb to power source and wait until both blue and green light stops blinking and become still.
- Open Pycharm and make a file config.py and write Api key, Bolt id, SID, mobile numbers, etc.
- Make one more python file alert.py.
- Install and import https://pypi.org/project/psutil/. Write the program.
AboutPsutil:
Psutil is a Python cross-platform library used to access system details and process utilities. It is used to keep track of various resources utilization in the system. Usage of resources like CPU, memory, disks, network, sensors can be monitored.
psutil.cpu_percent
( )
This function calculates the current system-wide CPU utilization as a percentage.
Output:
Comments