Line: 1 to 1 | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Added: | |||||||||||||
> > |
Exercises in PythonOne way to develop the course in a new direction is the replacement of the C programming language by Python. You should not be mislead however by thinking that this will make things substantially easier. In fact the string typing available in C helps you in many situations e.g. when reading out unsigned or signed char or short values from sensor registers, which may lead to strange effects when doing the same thing in Python. To start you off, I have already re-written the exercise solutions for the LEDS, and the devices that make up the meteorological station:
The HD44780 driverAll sensor drivers are implemented as Python classes and you must create an instance of the corresponding class. The file of the driver is called lcdDisplayClass and the class name is lcdDisplayClass as well. When you create an instance of the LCD driver class the connection to the pigpiod daemon is established and the Hitachi hd44780 is fully initialized. After this the device is ready to be used. These are the methods of the class:
The DHT11The DHT11 measures the temperature and the ambient humidity. The file with the python class is called dht11Class and the class Dht11. To instantiate the class you must pass the gpio PIN number to which the DHT11 is connected to. Here are the methods of the DHT11 class:
The BMP180 air pressure and temperature sensorThe class in implemented in the file Bmp180Class.py and its name is Bmp180Class. Here are the methods:
Comments
|