Core-Layer
  • Home
  • Blog
  • LINKS
  • ABOUT
  • Contact

Blog

Python - Hide mouse cursor on a Raspberry Pi (Raspbian)

30/10/2017

2 Comments

 
I recently needed to hide the cursor upon boot in the GUI on a Raspberry Pi running Raspbian. I found the following method which is easy to install and works great.

Install Unclutter and edit the LXDE autostart script:
sudo apt-get install unclutter
nano ~/.config/lxsession/LXDE-pi/autostart

Turn the cursor Off by adding the following line:
@unclutter -idle 0

Then you can reboot and cursor will disappear.
2 Comments

Raspberry Pi 3 and PIR Detector HC-SR501

30/10/2017

0 Comments

 
I recently purchased a PIR Detector HV-SR501 and here is a simple program to use it in Python with a Raspberry Pi 3.

Let's look at the wiring:​
Picture
CAUTION: Verify on the PIR sensor's board that it has to be wired as displayed, the pinout on the PIR sensor is, on some models, inverted compared to the picture.

Once wired, below is a Python program that reads from the Raspberry Pi 3's GPIO ping #11 and prints every second if a movement has been detected.
​
import RPi.GPIO as GPIO
import time

GPIO.setmode(GPIO.BOARD)
GPIO.setup(11, GPIO.IN)

while True:
      i=GPIO.input(11)
      if i==0:
           print      time.ctime(),": no mouvement detected"
     else:
           print time.ctime(),": !!!!!!!!!! mouvement detected !!!!!!!!!!"
      time.sleep(1)

You can change the two resistances on the other side of the PIR sensor using a screw driver to vary the delay and sensibility of the sensor.
0 Comments

    Archives

    July 2021
    July 2018
    March 2018
    October 2017
    May 2017
    April 2017
    March 2017
    October 2016
    February 2016
    January 2016

    Categories

    All
    API
    Chrome
    Cisco
    Code Qr
    Covid
    Dev
    Données Personnelles
    Fix
    IIS
    Issue
    Linux
    Microsoft
    Moto
    Network
    News
    Python
    Qr
    Qr Code
    Quebec
    Raspberry Pi
    Roadtrip
    Securité
    Security
    SQL
    Vulnerability
    Windows

    RSS Feed

Proudly powered by Weebly
  • Home
  • Blog
  • LINKS
  • ABOUT
  • Contact