Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 537
» Latest member: webtekmarketing1
» Forum threads: 392
» Forum posts: 1,912

Full Statistics

Online Users
There are currently 23 online users.
» 0 Member(s) | 20 Guest(s)
Bing, Google, Yandex

Latest Threads
flash voltage selection e...
Forum: ESP32
Last Post: LoriNagle
09-18-2020, 03:35 PM
» Replies: 4
» Views: 1,573
project is dormant?
Forum: General
Last Post: Sang15512
09-03-2020, 06:53 AM
» Replies: 28
» Views: 8,943
Power Management
Forum: General
Last Post: Simranto09
09-02-2020, 03:15 PM
» Replies: 4
» Views: 75,967
Problem with AXP202 Libra...
Forum: Issues
Last Post: thiago.nogueira
08-22-2020, 01:32 PM
» Replies: 0
» Views: 183
Latest updates
Forum: Announcements and updates
Last Post: faisyl
08-19-2020, 09:58 AM
» Replies: 10
» Views: 1,942
TTGO ESP TDisplay - Not W...
Forum: Issues
Last Post: Gman
08-16-2020, 07:24 PM
» Replies: 1
» Views: 153
Problem with the thread
Forum: Issues
Last Post: avanti
08-15-2020, 02:38 PM
» Replies: 9
» Views: 2,345
ulab Samples - FFT benchm...
Forum: General
Last Post: ph.robadel
08-13-2020, 02:14 AM
» Replies: 0
» Views: 205
SD
Forum: Hardware
Last Post: lobo
07-31-2020, 09:01 AM
» Replies: 3
» Views: 311
Integrating user modules ...
Forum: General
Last Post: mathieu
07-28-2020, 12:41 PM
» Replies: 1
» Views: 1,471

 
  Problem with AXP202 Library
Posted by: thiago.nogueira - 08-22-2020, 01:32 PM - Forum: Issues - No Replies

<p>Hello guys!<br><br>I have a problem using the AXP202 library. I have a TTGO-T-Beam 1.0 and I am starting to use it in my first micropython project.<br><br>First of all I would like to simply blink the LED and I couldn't do it anymore.<br><br>I'm using VSCode with pymakr and was able to install the esp32_psram_all_bt firmware.<br><br>I would like to use this library: https://github.com/lewisxhe/AXP202_PythonLibrary but I'm not sure how (as I said, it is my first project). I don't know if I need to download and place these files in a specific folder.<br><br>I downloaded these files and put them in a folder and tried to run main.py but this error appeared: OSError: I2C bus error. I don't know what else to do, any help is welcome.<br><br>Thank you very much in advance.<br></p>

Print this item

  ulab Samples - FFT benchmark with Sipeed MAixBiT in 1st place
Posted by: ph.robadel - 08-13-2020, 02:14 AM - Forum: General - No Replies

<p data-sourcepos="213:1-213:252" dir="auto"><a href="https://github.com/ph-robadel/ulab_samples" rel="nofollow noreferrer noopener" target="_blank">ulab Samples</a> is a repository with links, examples, benchmarks, etc, about <a href="https://github.com/v923z/micropython-ulab" rel="nofollow noreferrer noopener" target="_blank">ulab module</a>, a NumPy-like array manipulation library for MicroPython and CircuitPython.<br><br></p>
<p data-sourcepos="215:1-215:347" dir="auto">Most interesting is the <a href="https://github.com/ph-robadel/ulab_samples#benchmark-of-fft-with-1024-points" rel="nofollow noreferrer noopener" target="_blank"><strong>ulab FFT benchmark for 1024 points</strong></a>, where you can see, among other boards, the performance of <strong>Sipeed MAix BiT with MicroPython for K210 Lobo firmware</strong> : it <strong>is a clear winner in double precision (FP64) FFT</strong>, taking only <strong>1.030 ms</strong> !</p>
<p data-sourcepos="217:1-217:408" dir="auto">Sipeed MAix BiT with RISC-V 64bit Kendryte K210 has double precision (FP64) float point hardware support, and MicroPython for K210 Lobo firmware is currently only for double precision (FP64). But it would be very useful to have MicroPython for K210 Lobo firmware in two versions, one in single precision (FP32) and another in double precision (FP64), so the K210 microcontroller can show all its performance.<br><br></p>
<p data-sourcepos="219:1-219:100" dir="auto">See more <a href="https://github.com/ph-robadel/ulab_samples#analyses" rel="nofollow noreferrer noopener" target="_blank">comments in ulab Samples repository</a>.</p><p class="sceditor-nlf"><br></p>

Print this item

  TTGO ESP TDisplay - Not Working
Posted by: aualby - 08-08-2020, 02:46 PM - Forum: Issues - Replies (1)

<p>I am using&nbsp;<font color="#aaaaaa">MicroPython ESP32_LoBo_v3.2.24 - 2018-09-06 on ESP32 board with ESP32</font> on a TTGO ESP32 TDisplay board. Have modified the example as below to suit the pins. All I get is the back light comes on for a second then goes off. No errors. Have wasted a full day on it so far. Please help..... ripping my hair out.</p><p><br></p><p>

Code:
"""
Demo program demonstrating the capabities of the MicroPython display module
Author: LoBo (https://github/loboris)
Date:   08/10/2017

"""

import machine, display, time, math

tft = display.TFT()

# ESP32-WROVER-KIT v3:
#tft.init(tft.ST7789, rst_pin=18, backl_pin=5, miso=25, mosi=23, clk=19, cs=22, dc=21)

# Adafruit:
#tft.init(tft.ILI9341, width=240, height=320, miso=19, mosi=18, clk=5, cs=15, dc=33, bgr=True, hastouch=tft.TOUCH_STMPE, tcs=32)

# M5Stack:
#tft.init(tft.M5STACK, width=240, height=320, rst_pin=33, backl_pin=32, miso=19, mosi=23, clk=18, cs=14, dc=27, bgr=True, backl_on=1, invrot=3)

# TTGO TDisplay
tft.init(tft.ST7789, rst_pin=23, backl_pin=4, miso=0, mosi=19, clk=18, cs=5, dc=16)

# Others...
#tft.init(tft.ILI9341, width=240, height=320, miso=19,mosi=23,clk=18,cs=5,dc=26,tcs=27,hastouch=True, bgr=True)
#tft.init(tft.ST7735R, speed=10000000, spihost=tft.HSPI, mosi=13, miso=12, clk=14, cs=15, dc=27, rst_pin=26, hastouch=False, bgr=False, width=128, height=160)


def testt():
    while True:
        lastx = 0
        lasty = 0
        t,x,y = tft.gettouch()
        if t:
            dx = abs(x-lastx)
            dy = abs(y-lasty)
            if (dx &gt; 2) and (dy &gt; 2):
                tft.circle(x,y,4,tft.RED)
        time.sleep_ms(50)


maxx = 135
maxy = 240
miny = 12
touch = False

# fonts used in this demo
fontnames = (
    tft.FONT_Default,
    tft.FONT_7seg,
    tft.FONT_Ubuntu,
    tft.FONT_Comic,
    tft.FONT_Tooney,
    tft.FONT_Minya
)


# Check if the display is touched
#-------------
def touched():
    if not touch:
        return False
    else:
        tch,_,_ = tft.gettouch()
        if tch &lt;= 0:
            return False
        else:
            return True

# print display header
#----------------------
def header(tx, setclip):
    # adjust screen dimensions (depends on used display and orientation)
    global maxx, maxy, miny

    maxx, maxy = tft.screensize()
    tft.clear()
    if maxx &lt; 240:
        tft.font(tft.FONT_Small, rotate=0)
    else:
        tft.font(tft.FONT_Default, rotate=0)
    _,miny = tft.fontSize()
    miny += 5
    tft.rect(0, 0, maxx-1, miny-1, tft.OLIVE, tft.DARKGREY)
    tft.text(tft.CENTER, 2, tx, tft.CYAN, transparent=True)

    if setclip:
        tft.setwin(0, miny, maxx, maxy)

# Display some fonts
#-------------------
def dispFont(sec=5):
    header("DISPLAY FONTS", False)

    if maxx &lt; 240:
        tx = "MicroPython"
    else:
        tx = "Hi from MicroPython"
    starty = miny + 4

    n = time.time() + sec
    while time.time() &lt; n:
        y = starty
        x = 0
        i = 0
        while y &lt; maxy:
            if i == 0:
                x = 0
            elif i == 1:
                x = tft.CENTER
            elif i == 2:
                x = tft.RIGHT
            i = i + 1
            if i &gt; 2:
                i = 0
            
            for font in fontnames:
                if font == tft.FONT_7seg:
                    tft.font(font)
                    tft.text(x,y,"-12.45/",machine.random(0xFFFFFF))
                else:
                    tft.font(font)
                    tft.text(x,y,tx, machine.random(0xFFFFFF))
                _,fsz = tft.fontSize()
                y = y + 2 + fsz
                if y &gt; (maxy-fsz):
                    y = maxy
        if touched():
            break

# Display random fonts
#------------------------------
def fontDemo(sec=5, rot=False):
    tx = "FONTS"
    if rot:
        tx = "ROTATED " + tx
    header(tx, True)

    tx = "ESP32-MicrpPython"
    n = time.time() + sec
    while time.time() &lt; n:
        frot = 0
        if rot:
            frot = math.floor(machine.random(359)/5)*5
        for font in fontnames:
            if (not rot) or (font != tft.FONT_7seg):
                x = machine.random(maxx-8)
                if font != tft.FONT_7seg:
                    tft.font(font, rotate=frot)
                    _,fsz = tft.fontSize()
                    y = machine.random(miny, maxy-fsz)
                    tft.text(x,y,tx, machine.random(0xFFFFFF))
                else:
                    l = machine.random(6,12)
                    w = machine.random(1,l // 3)
                    tft.font(font, rotate=frot, dist=l, width=w)
                    _,fsz = tft.fontSize()
                    y = machine.random(miny, maxy-fsz)
                    tft.text(x,y,"-12.45/", machine.random(0xFFFFFF))
        if touched():
            break
    tft.resetwin()

# Display random lines
#-------------------
def lineDemo(sec=5):
    header("LINE DEMO", True)

    n = time.time() + sec
    while time.time() &lt; n:
        x1 = machine.random(maxx-4)
        y1 = machine.random(miny, maxy-4)
        x2 = machine.random(maxx-1)
        y2 = machine.random(miny, maxy-1)
        color = machine.random(0xFFFFFF)
        tft.line(x1,y1,x2,y2,color)
        if touched():
            break
    tft.resetwin()

# Display random circles
#----------------------------------
def circleDemo(sec=5,dofill=False):
    tx = "CIRCLE"
    if dofill:
        tx = "FILLED " + tx
    header(tx, True)

    n = time.time() + sec
    while time.time() &lt; n:
        color = machine.random(0xFFFFFF)
        fill = machine.random(0xFFFFFF)
        x = machine.random(4, maxx-2)
        y = machine.random(miny+2, maxy-2)
        if x &lt; y:
            r = machine.random(2, x)
        else:
            r = machine.random(2, y)
        if dofill:
            tft.circle(x,y,r,color,fill)
        else:
            tft.circle(x,y,r,color)
        if touched():
            break
    tft.resetwin()

#------------------
def circleSimple():
    tx = "CIRCLE"
    header(tx, True)

    x = 110
    y = 160
    r = 110
    z = 0
    while z &lt; 12:
        color = machine.random(0xFFFFFF)
        fill = machine.random(0xFFFFFF)
        tft.circle(x,y,r,color,fill)
        r -= 10
        x += 10
        z += 1

# Display random ellipses
#-----------------------------------
def ellipseDemo(sec=5,dofill=False):
    tx = "ELLIPSE"
    if dofill:
        tx = "FILLED " + tx
    header(tx, True)

    n = time.time() + sec
    while time.time() &lt; n:
        x = machine.random(4, maxx-2)
        y = machine.random(miny+2, maxy-2)
        if x &lt; y:
            rx = machine.random(2, x)
        else:
            rx = machine.random(2, y)
        if x &lt; y:
            ry = machine.random(2, x)
        else:
            ry = machine.random(2, y)
        color = machine.random(0xFFFFFF)
        if dofill:
            fill = machine.random(0xFFFFFF)
            tft.ellipse(x,y,rx,ry,15, color,fill)
        else:
            tft.ellipse(x,y,rx,ry,15,color)
        if touched():
            break
    tft.resetwin()

# Display random rectangles
#---------------------------------
def rectDemo(sec=5, dofill=False):
    tx = "RECTANGLE"
    if dofill:
        tx = "FILLED " + tx
    header(tx, True)

    n = time.time() + sec
    while time.time() &lt; n:
        x = machine.random(4, maxx-2)
        y = machine.random(miny, maxy-2)
        w = machine.random(2, maxx-x)
        h = machine.random(2, maxy-y)
        color = machine.random(0xFFFFFF)
        if dofill:
            fill = machine.random(0xFFFFFF)
            tft.rect(x,y,w,h,color,fill)
        else:
            tft.rect(x,y,w,h,color)
        if touched():
            break
    tft.resetwin()

# Display random rounded rectangles
#--------------------------------------
def roundrectDemo(sec=5, dofill=False):
    tx = "ROUND RECT"
    if dofill:
        tx = "FILLED " + tx
    header(tx, True)

    n = time.time() + sec
    while time.time() &lt; n:
        x = machine.random(2, maxx-18)
        y = machine.random(miny, maxy-18)
        w = machine.random(12, maxx-x)
        h = machine.random(12, maxy-y)
        if w &gt; h:
            r = machine.random(2, h // 2)
        else:
            r = machine.random(2, w // 2)
        color = machine.random(0xFFFFFF)
        if dofill:
            fill = machine.random(0xFFFFFF)
            tft.roundrect(x,y,w,h,r,color,fill)
        else:
            tft.roundrect(x,y,w,h,r,color)
        if touched():
            break
    tft.resetwin()
<br></p>

Print this item

  NOOB Needs Help with ESP32 TTGO Display
Posted by: Gman - 07-28-2020, 02:42 AM - Forum: ESP32 - No Replies

<p>Hi, Guys,</p><p><br></p><p>Got ESP32 TTGO Oled board. Installed Lobo Firmware!</p><p><p style="white-space: pre-wrap; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none; margin: 0px;">MicroPython ESP32_LoBo_v3.2.24 - 2018-09-06 on ESP32 board with ESP32<br>Started playing with display module and stuck as Can't find how to increase text size &amp; change the font:<br><br></p>import machine, display, time, math, network, utime<br><br>tft = display.TFT()<br>tft.init(<br>&nbsp; &nbsp; tft.ST7789,<br>&nbsp; &nbsp; bgr=False,<br>&nbsp; &nbsp; rot=tft.LANDSCAPE,<br>&nbsp; &nbsp; miso=17,<br>&nbsp; &nbsp; backl_pin=4,<br>&nbsp; &nbsp; backl_on=1,<br>&nbsp; &nbsp; mosi=19,<br>&nbsp; &nbsp; clk=18,<br>&nbsp; &nbsp; cs=5,<br>&nbsp; &nbsp; dc=16,<br>)<br><br><br><br>tft.setwin(40,52,320,240)<br>for i in range(0, 240):<br> color = 0xFFF000<br> tft.line(i, 0, i, 135, color)<br><br>tft.set_fg(0x000000)<br><br>#tft.ellipse(120, 67, 120, 67)<br><br>#tft.line(0, 0, 220, 135)<br><br>text = "XXXXXXXXXXXX!"<br><br><br>tft.text(<br>&nbsp; &nbsp; 120 - int(tft.textWidth(text) / 2), 65 - int(tft.fontSize() [1] / 2), text, 0xFFFFFF<br>)<br><br></p>

Print this item

  SD
Posted by: nogleo - 07-27-2020, 07:57 PM - Forum: Hardware - Replies (3)

<p>I've been meaning to use in my project sd storage and the ADCs on my Maixduino borad&nbsp;but looks like it's not possible for the esp32 and the sd slot pins are shared.</p><p>I'd like to know if it is possible for me to mount sd through an adaptor on other pins so I can use it all simultaneously.</p><p>And code-wise how should I do it? SPI?</p><p><br></p><p><br></p><p>help please and thanks in advance Smile</p>

Print this item

  Small modification to curl FTP module
Posted by: panilsunil - 07-25-2020, 05:38 AM - Forum: Ideas - No Replies

<p>A small modification implemented to CURL FTP module.</p><p>1. FTP Put command to send data directly from buffer instead of File. This helps in reducing the File I/O on flash memory.&nbsp;</p><p>&nbsp;(modified ftp_put to read from buffer instead of file)</p><p></p><pre style="box-sizing: border-box; font-family: SFMono-Regular, Consolas, &quot;Liberation Mono&quot;, Menlo, monospace; font-size: 13.6px; margin-top: 0px; margin-bottom: 0px; overflow-wrap: normal; padding: 16px; overflow: auto; line-height: 1.45; background-color: rgb(246, 248, 250); border-radius: 6px; word-break: normal; color: rgb(36, 41, 46); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;"><span class="pl-s1" style="box-sizing: border-box;">res</span><span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);">=</span><span class="pl-s1" style="box-sizing: border-box;">curl</span>.<span class="pl-en" style="box-sizing: border-box; color: rgb(111, 66, 193);">ftp_put_buf</span>(<span class="pl-s" style="box-sizing: border-box; color: rgb(3, 47, 98);">'ftp://loboris.eu/test/uploaded_boot.py'</span>,<span class="pl-s" style="box-sizing: border-box; color: rgb(3, 47, 98);">'esp32'</span>,<span class="pl-s" style="box-sizing: border-box; color: rgb(3, 47, 98);">'esp32user'</span>, <span class="pl-s" style="box-sizing: border-box; color: rgb(3, 47, 98);">buffer</span>)</pre><!--EndFragment-->

<p></p><p class="sceditor-nlf">2. FTP List gets all files info from server. A provision is made to check if a single file exists in server by getting only its attributes and no file body is downloaded.<br>&nbsp;(modified ftp_get to exclude body)<br><br>

<!--StartFragment--></p><pre style="box-sizing: border-box; font-family: SFMono-Regular, Consolas, &quot;Liberation Mono&quot;, Menlo, monospace; font-size: 13.6px; margin-top: 0px; margin-bottom: 0px; overflow-wrap: normal; padding: 16px; overflow: auto; line-height: 1.45; background-color: rgb(246, 248, 250); border-radius: 6px; word-break: normal; color: rgb(36, 41, 46); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;"><span class="pl-s1" style="box-sizing: border-box;">res</span><span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);">=</span><span class="pl-s1" style="box-sizing: border-box;">curl</span>.<span class="pl-en" style="box-sizing: border-box; color: rgb(111, 66, 193);">ftp_get_info</span>(<span class="pl-s" style="box-sizing: border-box; color: rgb(3, 47, 98);">'ftp://loboris.eu/ftptest.txt'</span>,<span class="pl-s" style="box-sizing: border-box; color: rgb(3, 47, 98);">'esp32'</span>,<span class="pl-s" style="box-sizing: border-box; color: rgb(3, 47, 98);">'esp32user'</span>)<br></pre><p></p><p class="sceditor-nlf">esp32/modcurl.c and esp32/libs/espcurl.c files attached.&nbsp;<br>This is a small work and requested to verify and comment.<br><br></p>



Attached Files
.zip   curl_mod.zip (Size: 15.33 KB / Downloads: 0)
Print this item

  irq not work
Posted by: alien1983 - 07-13-2020, 03:20 AM - Forum: MicroPython - Replies (1)

<p>Hi,</p><p>The interruption/callback does not work for me...</p><p><br></p><p>

</p><p>def callback(p):<br>&nbsp; &nbsp; print('pin change', p)</p><p>
<!--StartFragment-->
<!--EndFragment-->&nbsp;</p><p><br></p><p>
<!--StartFragment-->
<!--EndFragment-->

<br></p><p>p0 = machine.Pin(0, machine.Pin.IN, machine.Pin.PULL_UP, handler=callback('p0'), trigger=machine.Pin.IRQ_RISING | machine.Pin.IRQ_FALLING)<br></p><p>
</p><p><br></p><p>During start, the function starts once "<!--StartFragment-->callback<!--EndFragment-->()"</p><p><br></p><p>The Prog button (Pin 0) does not respond to
<!--StartFragment-->callback<!--EndFragment--> function.<br></p>

Print this item

Question usqlite3 implemented on ESP32 ?
Posted by: water - 06-30-2020, 10:27 AM - Forum: MicroPython - No Replies

<p><br></p>

Print this item

  Ethernet
Posted by: kulich - 06-11-2020, 06:15 AM - Forum: Hardware - No Replies

Hello.

Is support for Ethernet modules, such as the W5500, being considered?

Thanks.

Print this item

  Having trouble programming gpio pin.
Posted by: Glass - 06-10-2020, 05:23 PM - Forum: MicroPython - Replies (1)

Hello,  I am new to micropython,  and have been following the micropython documentation. 
I am testing gpio pin but keep getting error message.
 
I type:
pyb.Pin     and get     <class 'Pin'>

I then type:
p_out = Pin('X1',  Pin. OUT_PP)      and get the below error message. 

Trace back (most recent call last) :
    Five "<stdin>",  line 1, in <module>
NameError: name  'Pin' is not defined

Is anyone able to tell me where I am going wrong?

Print this item