Today I have ordered DHT11 in ebay.Just need to do some experiment with GPIO pins on Raspberry Pi in input mode.
DHT11 Temperature and Humidity Sensor features a calibrated
digital signal output with the temperature and humidity sensor complex.
Its technology ensures the high reliability and excellent long-term
stability. A high-performance 8-bit microcontroller is connected. This
sensor includes a resistive element and a sense of wet NTC temperature
measuring devices. It has excellent quality, fast response,
anti-interference ability and high cost performance advantages
DHT11 timing diagram:
DHT11 connection Diagram:
Waiting for it to come.................................
I was actually trying to write a simple program which reads the input from keyboard and mouse to Pygame python program. when I searched , found its easy and within a few lines of code in Python we can able to control the movements of an image object in python.
The function image.load can load the image to the screen.
image.get.rect() get the rectangle coordinates of the image position.
Event 'pg.key.get_pressed' reads the key press events and 'ÍF' clause checks which key has been given as inputs in the below program.
The same mouse click event also capturing inside the while loop which runs till the variable 'running' is true.
Based on the key inputs the rectangle image object position coordinates were changed to make movements to the image.
Raspberry Pi Pygame to control Image movements through External Keyboard or mouse
I am thinking of Python Program games for Raspberry Pi. Searching google a lot for this nowdays. But looks like a bit of logical thinking required for a building games . But still found PYGAME looks easy to build some simple games http://pygame.org/wiki/tutorials
Pygame is a set of Python modules designed for writing games. Pygame adds
functionality on top of the excellent SDL library. This allows you to create fully featured games and
multimedia programs in the python language. Pygame is highly portable and
runs on nearly every platform and operating system.
Looking to set up a game somehow with my logical skills and that interface with external joystick connected to Raspberry Pi...
To play with 220V , we should be a little careful and need to take all precautions with testers to check to 220v supply.
This experiment we need to have Raspberry Pi ( already we have) and Relay Board which actually drive the switch and break the ciruit based on the 7th Pin voltage in GPIO pin.
Programs which we are gointo use same the Pyhon program we used to blink the LED from Flask python webpage
Flask is lightweight web application framework written in python and its very much suited for Raspberry Pi board. Controlling the LED connectioned to GPIO pin 7 is easy ,through the python program written importing Flask.
Steps to control LED connected to Raspberry Pi through WebPage
Step1: install Flask in Raspberry Pi.Follow below steps
Step2. Connect the LED to the GPIO pin 7 through 470ohm resister
Step3: Writing Programs in Python Flask
First you need to create a python program which actually rendor the html templates stored in the 'templates' directory.
1.Create a folder called 'pythonsites' in your home directory and you can write gpio.py in that folder as below. Refer the Flask site for example programs