{
 "meta": {
  "cloudId": "pxt/microbit",
  "editor": "blocksprj",
  "name": "5\u00ba S2 \u00b7 Contador con los botones"
 },
 "source": "{\"pxt.json\": \"{\\n    \\\"name\\\": \\\"5\u00ba S2 \u00b7 Contador con los botones\\\",\\n    \\\"description\\\": \\\"Gu\u00eda C\u00f3digo Escuela 4.0 \u00b7 5\u00ba S2\\\",\\n    \\\"dependencies\\\": {\\n        \\\"core\\\": \\\"*\\\",\\n        \\\"radio\\\": \\\"*\\\",\\n        \\\"microphone\\\": \\\"*\\\"\\n    },\\n    \\\"files\\\": [\\n        \\\"main.blocks\\\",\\n        \\\"main.ts\\\",\\n        \\\"README.md\\\"\\n    ],\\n    \\\"preferredEditor\\\": \\\"blocksprj\\\"\\n}\", \"main.blocks\": \"<xml xmlns=\\\"https://developers.google.com/blockly/xml\\\"><variables><variable id=\\\"l5w`k?]fAqcsDXB4}:ma\\\">contador</variable></variables><block type=\\\"pxt-on-start\\\" x=\\\"20\\\" y=\\\"20\\\"><statement name=\\\"HANDLER\\\"><block type=\\\"basic_show_icon\\\"><field name=\\\"i\\\">IconNames.Heart</field></block></statement></block><block type=\\\"device_button_event\\\" x=\\\"294\\\" y=\\\"20\\\"><field name=\\\"NAME\\\">Button.A</field><statement name=\\\"HANDLER\\\"><block type=\\\"variables_change\\\"><field name=\\\"VAR\\\" id=\\\"l5w`k?]fAqcsDXB4}:ma\\\">contador</field><value name=\\\"VALUE\\\"><shadow type=\\\"math_number\\\"><field name=\\\"NUM\\\">1</field></shadow></value><next><block type=\\\"device_show_number\\\"><value name=\\\"number\\\"><block type=\\\"variables_get\\\"><field name=\\\"VAR\\\" id=\\\"l5w`k?]fAqcsDXB4}:ma\\\">contador</field></block></value></block></next></block></statement></block><block type=\\\"device_button_event\\\" x=\\\"633\\\" y=\\\"20\\\"><field name=\\\"NAME\\\">Button.B</field><comment pinned=\\\"false\\\" h=\\\"80\\\" w=\\\"160\\\">Reto: que baje con B y no pase de 0</comment><statement name=\\\"HANDLER\\\"><block type=\\\"controls_if\\\"><value name=\\\"IF0\\\"><shadow type=\\\"logic_boolean\\\"><field name=\\\"BOOL\\\">TRUE</field></shadow><block type=\\\"logic_compare\\\"><field name=\\\"OP\\\">GT</field><value name=\\\"A\\\"><shadow type=\\\"math_number\\\"><field name=\\\"NUM\\\">0</field></shadow><block type=\\\"variables_get\\\"><field name=\\\"VAR\\\" id=\\\"l5w`k?]fAqcsDXB4}:ma\\\">contador</field></block></value><value name=\\\"B\\\"><shadow type=\\\"math_number\\\"><field name=\\\"NUM\\\">0</field></shadow></value></block></value><statement name=\\\"DO0\\\"><block type=\\\"variables_change\\\"><field name=\\\"VAR\\\" id=\\\"l5w`k?]fAqcsDXB4}:ma\\\">contador</field><value name=\\\"VALUE\\\"><shadow type=\\\"math_number\\\"><field name=\\\"NUM\\\">-1</field></shadow></value></block></statement><next><block type=\\\"device_show_number\\\"><value name=\\\"number\\\"><block type=\\\"variables_get\\\"><field name=\\\"VAR\\\" id=\\\"l5w`k?]fAqcsDXB4}:ma\\\">contador</field></block></value></block></next></block></statement></block></xml>\", \"main.ts\": \"let contador = 0\\ninput.onButtonPressed(Button.A, function () {\\n    contador += 1\\n    basic.showNumber(contador)\\n})\\n// Reto: que baje con B y no pase de 0\\ninput.onButtonPressed(Button.B, function () {\\n    if (contador > 0) {\\n        contador += -1\\n    }\\n    basic.showNumber(contador)\\n})\\nbasic.showIcon(IconNames.Heart)\\n\", \"README.md\": \"# 5\u00ba S2 \u00b7 Contador con los botones\\n\\nGu\u00eda did\u00e1ctica C\u00f3digo Escuela 4.0 \u00b7 5\u00ba S2. Programa de referencia para el docente.\\n\"}"
}