help.c 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. * This file is part of the MicroPython project, http://micropython.org/
  3. *
  4. * Development of the code in this file was sponsored by Microbric Pty Ltd
  5. *
  6. * The MIT License (MIT)
  7. *
  8. * Copyright (c) 2013-2016 Damien P. George
  9. *
  10. * Permission is hereby granted, free of charge, to any person obtaining a copy
  11. * of this software and associated documentation files (the "Software"), to deal
  12. * in the Software without restriction, including without limitation the rights
  13. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  14. * copies of the Software, and to permit persons to whom the Software is
  15. * furnished to do so, subject to the following conditions:
  16. *
  17. * The above copyright notice and this permission notice shall be included in
  18. * all copies or substantial portions of the Software.
  19. *
  20. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  21. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  22. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  23. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  24. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  25. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  26. * THE SOFTWARE.
  27. */
  28. #include "py/builtin.h"
  29. const char esp32_help_text[] =
  30. "Welcome to MicroPython on the ESP32!\n"
  31. "\n"
  32. "For generic online docs please visit http://docs.micropython.org/\n"
  33. "\n"
  34. "For access to the hardware use the 'machine' module:\n"
  35. "\n"
  36. "import machine\n"
  37. "pin12 = machine.Pin(12, machine.Pin.OUT)\n"
  38. "pin12.value(1)\n"
  39. "pin13 = machine.Pin(13, machine.Pin.IN, machine.Pin.PULL_UP)\n"
  40. "print(pin13.value())\n"
  41. "i2c = machine.I2C(scl=machine.Pin(21), sda=machine.Pin(22))\n"
  42. "i2c.scan()\n"
  43. "i2c.writeto(addr, b'1234')\n"
  44. "i2c.readfrom(addr, 4)\n"
  45. "\n"
  46. "Basic WiFi configuration:\n"
  47. "\n"
  48. "import network\n"
  49. "sta_if = network.WLAN(network.STA_IF); sta_if.active(True)\n"
  50. "sta_if.scan() # Scan for available access points\n"
  51. "sta_if.connect(\"<AP_name>\", \"<password>\") # Connect to an AP\n"
  52. "sta_if.isconnected() # Check for successful connection\n"
  53. "\n"
  54. "Control commands:\n"
  55. " CTRL-A -- on a blank line, enter raw REPL mode\n"
  56. " CTRL-B -- on a blank line, enter normal REPL mode\n"
  57. " CTRL-C -- interrupt a running program\n"
  58. " CTRL-D -- on a blank line, do a soft reset of the board\n"
  59. " CTRL-E -- on a blank line, enter paste mode\n"
  60. "\n"
  61. "For further help on a specific object, type help(obj)\n"
  62. "For a list of available modules, type help('modules')\n"
  63. ;