میکرو پایتون چیست ؟
یک نسخه از زبان برنامه نویسی پایتون با سرعت بالا می باشد که در برخی از میکروکنترلرها , ماژول های همچون esp8266 و.... مورد استفاده قرار می گیرد. هدف از این فریمور میکروپایتون ،استفاده از زبان برنامه نویسی پایتون در ابزارهای امبدد می باشد.
@micropython_iot
یک نسخه از زبان برنامه نویسی پایتون با سرعت بالا می باشد که در برخی از میکروکنترلرها , ماژول های همچون esp8266 و.... مورد استفاده قرار می گیرد. هدف از این فریمور میکروپایتون ،استفاده از زبان برنامه نویسی پایتون در ابزارهای امبدد می باشد.
@micropython_iot
فریمور استاندارد برای PYBv1
http://micropython.org/resources/firmware/pybv10-20180307-v1.9.3-407-g250b24fe.dfu
@micropython_iot
http://micropython.org/resources/firmware/pybv10-20180307-v1.9.3-407-g250b24fe.dfu
@micropython_iot
Micro-Python-Windows-setup.pdf
603 KB
استفاده از میکروپایتون و pyboard با ویندوز
@raspberry_python
@raspberry_python
لینک دانلود mu editor جهت نوشتن اسکریپت ، پروگرم کردن کردن میکروبیت و اتصال کامپیوتر به مینی کامپیوتر میکروبیت(نسخه ویندوز ، لینوکس)
http://codewith.mu/
@micropython_iot
http://codewith.mu/
@micropython_iot
🌟دستورات کنترل عمومی pyboard
import pyb
pyb.repl_uart(pyb.UART(1, 9600))
# duplicate REPL on UART(1)
pyb.wfi()
# pause CPU, waiting for interrupt
pyb.freq()
# get CPU and bus frequencies
pyb.freq(60000000)
# set CPU freq to 60MHz
pyb.stop()
# stop CPU, waiting for external interrupt
@micropython_iot
import pyb
pyb.repl_uart(pyb.UART(1, 9600))
# duplicate REPL on UART(1)
pyb.wfi()
# pause CPU, waiting for interrupt
pyb.freq()
# get CPU and bus frequencies
pyb.freq(60000000)
# set CPU freq to 60MHz
pyb.stop()
# stop CPU, waiting for external interrupt
@micropython_iot
اسکریپت Lua برای L35
Vref = 3.3
resolution = Vref/1023
analogVtg = adc.read(0)
if analogVtg> 1023 then
analogVtg = 1023
end
temperature = (analogVtg * resolution)*100
print('LM35 Temperature:', temperature)
@micropython_iot
Vref = 3.3
resolution = Vref/1023
analogVtg = adc.read(0)
if analogVtg> 1023 then
analogVtg = 1023
end
temperature = (analogVtg * resolution)*100
print('LM35 Temperature:', temperature)
@micropython_iot
اسکریپت Lua برای DHT11
pin = 1
status, temp, humi, temp_dec, humi_dec = dht.read(pin)--read dht11 from pin
if status == dht.OK then —check status is ok and print temperature and humidity
print(string.format("DHT Temperature:%d.%03d;Humidity:%d.%03d",
math.floor(temp),
temp_dec,
math.floor(humi),
humi_dec
))
elseif status == dht.ERROR_CHECKSUM then —else print either status
print( "DHT Checksum error." )
elseif status ==
dht.ERROR_TIMEOUT then
print( "DHT timed out." )
end
🆔 @micropython_iot
pin = 1
status, temp, humi, temp_dec, humi_dec = dht.read(pin)--read dht11 from pin
if status == dht.OK then —check status is ok and print temperature and humidity
print(string.format("DHT Temperature:%d.%03d;Humidity:%d.%03d",
math.floor(temp),
temp_dec,
math.floor(humi),
humi_dec
))
elseif status == dht.ERROR_CHECKSUM then —else print either status
print( "DHT Checksum error." )
elseif status ==
dht.ERROR_TIMEOUT then
print( "DHT timed out." )
end
🆔 @micropython_iot