NodeMCU Projects: Difference between revisions
Content added Content deleted
(Created page with "= Micropython = *Installing: sudo pip install esptool esptool.py --port /dev/ttyUSB0 erase_flash esptool.py --port /dev/ttyUSB0 --baud 460800 write_flash --flash_size=detec...") |
No edit summary |
||
Line 1: | Line 1: | ||
[[Category:NodeMCU]] |
|||
__TOC__ |
|||
<br/> |
|||
= Micropython = |
= Micropython = |
||
*Installing: |
*Installing: |
||
Line 44: | Line 48: | ||
machine.freq() # get the current frequency of the CPU |
machine.freq() # get the current frequency of the CPU |
||
machine.freq(160000000) # set the CPU frequency to 160 MHz |
machine.freq(160000000) # set the CPU frequency to 160 MHz |
||
<br /> |
|||
;References |
|||
<references/> |
|||
<br /> |
|||
<br /> |
|||
<br /> |
|||
{{DISQUS}} |
Revision as of 00:44, 26 November 2017
Micropython
- Installing:
sudo pip install esptool esptool.py --port /dev/ttyUSB0 erase_flash esptool.py --port /dev/ttyUSB0 --baud 460800 write_flash --flash_size=detect 0 ~/Desktop/esp8266-20171101-v1.9.3.bin
- Connecting via Terminal:
sudo apt install picocom picocom /dev/ttyUSB0 -b115200
- Connecting via REPL(web):
import webrepl_setup
Following on-screen instructions. After reboot, it will be available for connection. If you disabled automatic start-up on boot, you may run configured daemon on demand using:
import webrepl webrepl.start()
- Playing with GPIO:
import machine pin = machine.Pin(2, machine.Pin.OUT) pin.on() pin.off()
def toggle(p): p.value(not p.value())
toggle(pin)
import time while True: toggle(pin) time.sleep_ms(500)
- Checking filesystem:
import os os.listdir()
- Checking Machine Frequency & Overclocking:
import machine machine.freq() # get the current frequency of the CPU machine.freq(160000000) # set the CPU frequency to 160 MHz
- References
{{#widget:DISQUS
|id=networkm
|uniqid=NodeMCU Projects
|url=https://aman.awiki.org/wiki/NodeMCU_Projects
}}