Raspberry Pi – Scheduling Tasks

In this video I’ll be showing you how to schedule python scripts to run on your Raspberry Pi.

 

To test out the scheduled tasks that we will be creating I’ll be using a python script to blink the LED.

For this project you’ll need:

  • A Raspberry Pi
  • Suitable USB power supply
  • SD card with Raspbian image on it
  • An LED
  • 270ohm resistor
  • Jumper wires

Enriched with herbal sexual remedies like Cistanche Deserticola, Goji berry and Fructus Lycii, these pills increase blood flow to vagina while stimulating the brain. https://unica-web.com/archive/2011/General-Assembly/filmlibrary11.pdf levitra sale One levitra samples https://unica-web.com/ENGLISH/2013/presidents-letter2013-2-english.html of the best ways to increase energy to keep themselves 100% fit in their daily activities. Detox viagra no and cleansing benefits people with addictions to numerous substances. Treatment There are many medical treatments available for this dysfunction are behavioral techniques, exercise and medications. buy levitra cheap
To begin insert the LED and resistor into a breadboard with the resistor connected to the negative side of the LED. Followed by connecting the positive leg of the LED to GPIO 14 and the other side of the resistor to ground on the Pi.

I’m then going to insert the SD card, power up the pi and login. Then navigate to the desktop and create a directory called led using this command.

Cd Desktop, sudo mkdir led, cd led

To create the python script enter this command sudo nano blink.py and enter the following code into python script. To test that the script blinks the led enter the following command sudo python blink.py. Once we know that the script works we can schedule a task to execute the script using the cron tab. Enter this command to edit the cron tab crontab -e.

We can then enter this line in the file to set our python script to execute once every minute.

* * * * * python /home/pi/Desktop/LED/blink.py

The timing is indicated by the stars after saving the file you can view the cron tab tasks by using this command crontab -l. For more information about creating cron jobs, check out the raspberrypi.org website.