31
31
#include "lib/utils/pyhelp.h"
32
32
33
33
STATIC const char * help_text =
34
- "Welcome to MicroPython!\n"
34
+ "Welcome to MicroPython on the ESP32 !\n"
35
35
"\n"
36
- "For online docs please visit http://docs.micropython.org/en/latest/esp8266/ .\n"
37
- "For diagnostic information to include in bug reports execute 'import port_diag'.\n"
36
+ "For generic online docs please visit http://docs.micropython.org/\n"
38
37
"\n"
39
- "Basic WiFi configuration :\n"
38
+ "For access to the hardware use the 'machine' module :\n"
40
39
"\n"
41
- "import network\n"
42
- "sta_if = network.WLAN(network.STA_IF); sta_if.active(True)\n"
43
- "sta_if.scan() # Scan for available access points\n"
44
- "sta_if.connect(\"<AP_name>\", \"<password>\") # Connect to an AP\n"
45
- "sta_if.isconnected() # Check for successful connection\n"
46
- "# Change name/password of ESP8266's AP:\n"
47
- "ap_if = network.WLAN(network.AP_IF)\n"
48
- "ap_if.config(essid=\"<AP_NAME>\", authmode=network.AUTH_WPA_WPA2_PSK, password=\"<password>\")\n"
40
+ "import machine\n"
41
+ "pin12 = machine.Pin(12, machine.Pin.OUT)\n"
42
+ "pin12.value(1)\n"
43
+ "pin13 = machine.Pin(13, machine.Pin.IN, machine.Pin.PULL_UP)\n"
44
+ "print(pin13.value())\n"
45
+ "i2c = machine.I2C(scl=machine.Pin(21), sda=machine.Pin(22))\n"
46
+ "i2c.scan()\n"
47
+ "i2c.writeto(addr, b'1234')\n"
48
+ "i2c.readfrom(addr, 4)\n"
49
49
"\n"
50
50
"Control commands:\n"
51
51
" CTRL-A -- on a blank line, enter raw REPL mode\n"
@@ -60,7 +60,7 @@ STATIC const char *help_text =
60
60
STATIC mp_obj_t builtin_help (uint n_args , const mp_obj_t * args ) {
61
61
if (n_args == 0 ) {
62
62
// print a general help message
63
- printf ( "%s" , help_text );
63
+ mp_printf ( MP_PYTHON_PRINTER , "%s" , help_text );
64
64
65
65
} else {
66
66
// try to print something sensible about the given object
0 commit comments