Case 10 - Display weather conditions

Part 1   Objective

Use IoT blocks to connect to the network, select a city to obtain its weather condition, then Codey's screen displays the weather condition of the city.

36.gif

Part 2   Preparation

  • Codey (robot controller) x 1

  • USB cable x 1

  • Computer with network access x 1

Connect Codey to the computer by using the USB cable, open mBlock 5 (PC client or web version), delete the default device, click +add, select Codey from the Device Library and then click Set as mostly used device in the upper left corner, click Connect, and select the Upload mode.

37.gif

38.gif

Part 3   Programming

  1. Click + extension and then click + Add below IoT.

  2. Use IoT blocks together with Looks blocks and Control blocks, and click Upload to obtain and display the weather condition of a city.

39.gif

Part 4   Practice

  1. Try to obtain the weather condition and temperature of your city.

  2. Try to display the weather condition, the maximum temperature, and the minimum temperature of your city in turn.

Was this article helpful?
1 out of 1 found this helpful

Comments

0 comments

Please sign in to leave a comment.