{
  "format": "evn-blocks",
  "version": 3,
  "title": "Environment sensor: every block",
  "needs": "the environment sensor (BME280) on I2C port 1",
  "description": "All three values of the environment sensor, once a second for 20 s: temperature in degrees Celsius, humidity in % and air pressure in pascals (about 101300 Pa at sea level). Breathe on the sensor and watch the humidity and the temperature go up.",
  "workspace": {
    "blocks": {
      "languageVersion": 0,
      "blocks": [
        {
          "type": "evn_setup_start",
          "x": 30,
          "y": 30,
          "next": {
            "block": {
              "type": "evn_env_setup",
              "fields": {
                "PORT": "1"
              }
            }
          }
        },
        {
          "type": "evn_program_start",
          "x": 30,
          "y": 115,
          "next": {
            "block": {
              "type": "evn_comment",
              "fields": {
                "TEXT": "breathe on the sensor while this runs"
              },
              "next": {
                "block": {
                  "type": "controls_repeat_ext",
                  "inputs": {
                    "TIMES": {
                      "shadow": {
                        "type": "math_number",
                        "fields": {
                          "NUM": 20
                        }
                      }
                    },
                    "DO": {
                      "block": {
                        "type": "text_print",
                        "inputs": {
                          "TEXT": {
                            "block": {
                              "type": "text_join",
                              "inputs": {
                                "ADD0": {
                                  "shadow": {
                                    "type": "text",
                                    "fields": {
                                      "TEXT": "temperature C "
                                    }
                                  }
                                },
                                "ADD1": {
                                  "block": {
                                    "type": "evn_env_value",
                                    "fields": {
                                      "PORT": "1",
                                      "WHAT": "temperature"
                                    }
                                  }
                                }
                              }
                            }
                          }
                        },
                        "next": {
                          "block": {
                            "type": "text_print",
                            "inputs": {
                              "TEXT": {
                                "block": {
                                  "type": "text_join",
                                  "inputs": {
                                    "ADD0": {
                                      "shadow": {
                                        "type": "text",
                                        "fields": {
                                          "TEXT": "humidity % "
                                        }
                                      }
                                    },
                                    "ADD1": {
                                      "block": {
                                        "type": "evn_env_value",
                                        "fields": {
                                          "PORT": "1",
                                          "WHAT": "humidity"
                                        }
                                      }
                                    }
                                  }
                                }
                              }
                            },
                            "next": {
                              "block": {
                                "type": "text_print",
                                "inputs": {
                                  "TEXT": {
                                    "block": {
                                      "type": "text_join",
                                      "inputs": {
                                        "ADD0": {
                                          "shadow": {
                                            "type": "text",
                                            "fields": {
                                              "TEXT": "pressure Pa "
                                            }
                                          }
                                        },
                                        "ADD1": {
                                          "block": {
                                            "type": "evn_env_value",
                                            "fields": {
                                              "PORT": "1",
                                              "WHAT": "pressure"
                                            }
                                          }
                                        }
                                      }
                                    }
                                  }
                                },
                                "next": {
                                  "block": {
                                    "type": "evn_wait",
                                    "inputs": {
                                      "TIME": {
                                        "shadow": {
                                          "type": "math_number",
                                          "fields": {
                                            "NUM": 1000
                                          }
                                        }
                                      }
                                    }
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      ]
    }
  }
}
