STRING works not with LCD

C programming, build, interpreter/VM.
Target audience: MicroPython Developers.
Post Reply
User avatar
polygontwist
Posts: 36
Joined: Sat Jun 28, 2014 4:54 pm
Location: Germany, Rostock
Contact:

STRING works not with LCD

Post by polygontwist » Sun Jun 29, 2014 7:58 am

Hello,

i have submit a DEMO (http://forum.micropython.org/viewtopic.php?f=5&t=187 first Code).
if I use STRING operations in LCD there after awhile error. The system is stuck and all the LEDs light up.

The following script works with STRING without problems.
Can anyone understand the error with LCD?

Code: Select all

blueled = pyb.LED(4)

intensity = 0
counter = 1
switch = pyb.Switch()
s=""

while not switch():
	intensity=intensity+counter
	s+="g"
	if intensity>15: 
		counter=-1
		s=""
	if intensity<1: counter=1
	print(s)
	blueled.intensity(intensity)
	pyb.delay(10)

nelfata
Posts: 74
Joined: Wed Apr 30, 2014 10:50 pm

Re: STRING works not with LCD

Post by nelfata » Sun Jun 29, 2014 8:05 am

I have seen this fairly often, but nothing to do with strings (in my code). I think there is some lurking bug somewhere in the firmware (maybe memory leak...) but it is very hard to make repeatable to figure out the problem.
Just FYI.

pfalcon
Posts: 1155
Joined: Fri Feb 28, 2014 2:05 pm

Re: STRING works not with LCD

Post by pfalcon » Sun Jun 29, 2014 6:13 pm

There're currently no known memory leaks in MicroPython interpreter. If you suspect one, please prepare a testcase which demonstrates it on "unix" version and submit a bug report. If you unable to reproduce it with "unix" version, the usual suspect should be bug or race condition in STM32 code, not in MicroPython interpreter per se (good testcase for stm32 port would helpful too of course).

As for starting message of this thread, I'm not sure I understand it. For example, what is "STRING" (capitalized)? There's no such type/function/method in Python (and if it existed, it would name a constant).
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/

User avatar
polygontwist
Posts: 36
Joined: Sat Jun 28, 2014 4:54 pm
Location: Germany, Rostock
Contact:

Re: STRING works not with LCD

Post by polygontwist » Sun Jun 29, 2014 10:22 pm

pfalcon wrote: As for starting message of this thread, I'm not sure I understand it. For example, what is "STRING" (capitalized)? There's no such type/function/method in Python (and if it existed, it would name a constant).
STRING is Text, the capitalized has no meaning.

Code: Select all

s="string text"

Post Reply