Manchmal ist es sinnvoller, ein Mausereignis unabhängig von der draw-Funktion auszuwerten.
Dazu können sogenannte event-Funktionen (Ereignisfunktionen), wie im folgenden Beispiel dargestellt. genutzt werden. Continue reading “Using mouse-events”
Manchmal ist es sinnvoller, ein Mausereignis unabhängig von der draw-Funktion auszuwerten.
Dazu können sogenannte event-Funktionen (Ereignisfunktionen), wie im folgenden Beispiel dargestellt. genutzt werden. Continue reading “Using mouse-events”
Interessante Programme lassen sich realisieren, wenn auf Benutzereingaben reagiert werden kann. Eine Möglichkeit bietet die Mausbedienung. Dazu lässt sich innerhalb des Programms einfach ermitteln an welcher Position sich die Maus befindet und ob eine Taste gedrückt wurde.
Wenn sich Befehlssequenzen wie zum Beispiel bei der Erzeugung von grafischen Mustern ständig wiederholen, ist oft die Verwendung der Kontrollstruktur „Schleife“ sehr nützlich.
Mit einer Schleife können Programmabschnitte wiederholt ausgeführt werden. Es gibt verschiedene Schleifentypen. Im Folgenden wird die Verwendung der while-Schleife beschrieben.
In order to enable the programming of IoT devices even without a line connection, the WMOS microcontroller can also be programmed with little effort over the air (WIFI).
In the last chapter, you learned how to send data to the broker.
In the next step, the IoT device should be able to receive data in order to be remotely controlled.
After an existing internet connection, the data should now be sent to the cloud. For this the protocol MQTT is used.
For the real IoT application, the microcontroller still needs to be able to spark into the network. For this purpose, a WIFI connection is established in the following step.
In the next step, the sensor for the detection of humidity and temperature should be added.
For this project, the popular digital sensor DHT11 or DHT22 (more expensive but more accurate) is used.
First approach to realize how a microcontroller plattform works is to implement really simple solutions to understand the process of connecting hardware to the board and develop appropriate programs.
Very suitable for first steps is the extremely inexpensive microcontroller WMOS D1 Mini with integrated WIFI chip of the type ESP-8266EX.
This course will develop a device to record the illuminance, temperature and humidity of a room. Later the control of a fan and a heater should be possible.