First off great to see you've got it going! Once you have the basics of Lua you can quite easily make little programs, games. It's a challenge to work inside the limits of the hardware but that was part of the fun.Thanks! That's so awesome! I like the Mandelbrot set! I used to have it for wallpaper on a few computers.
In the lua interpreter, I typed it all in, that code you said to try, but inside a 'do' 'end'
Image may be NSFW.
Clik here to view.
So, it works, the binaries build. Not sure what the errors are all about. I found errors are in build/CMakeError.logCode:
Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.Compiler: /usr/src/arm-gnu-toolchain/bin/arm-none-eabi-gcc Build flags: ;-mcpu=cortex-m0plus;-mthumbId flags: The output was:1/usr/src/arm-gnu-toolchain/bin/../lib/gcc/arm-none-eabi/13.3.1/../../../../arm-none-eabi/bin/ld: /usr/src/arm-gnu-toolchain/bin/../lib/gcc/arm-none-eabi/13.3.1/../../../../arm-none-eabi/lib/thumb/v6-m/nofp/libc.a(libc_a-exit.o): in function `exit':exit.c:(.text.exit+0x16): undefined reference to `_exit'/usr/src/arm-gnu-toolchain/bin/../lib/gcc/arm-none-eabi/13.3.1/../../../../arm-none-eabi/bin/ld: /usr/src/arm-gnu-toolchain/bin/../lib/gcc/arm-none-eabi/13.3.1/../../../../arm-none-eabi/lib/thumb/v6-m/nofp/libc.a(libc_a-sbrkr.o): in function `_sbrk_r':sbrkr.c:(.text._sbrk_r+0xc): undefined reference to `_sbrk'/usr/src/arm-gnu-toolchain/bin/../lib/gcc/arm-none-eabi/13.3.1/../../../../arm-none-eabi/bin/ld: /usr/src/arm-gnu-toolchain/bin/../lib/gcc/arm-none-eabi/13.3.1/../../../../arm-none-eabi/lib/thumb/v6-m/nofp/libc.a(libc_a-writer.o): in function `_write_r':writer.c:(.text._write_r+0x10): undefined reference to `_write'/usr/src/arm-gnu-toolchain/bin/../lib/gcc/arm-none-eabi/13.3.1/../../../../arm-none-eabi/bin/ld: /usr/src/arm-gnu-toolchain/bin/../lib/gcc/arm-none-eabi/13.3.1/../../../../arm-none-eabi/lib/thumb/v6-m/nofp/libc.a(libc_a-closer.o): in function `_close_r':closer.c:(.text._close_r+0xc): undefined reference to `_close'/usr/src/arm-gnu-toolchain/bin/../lib/gcc/arm-none-eabi/13.3.1/../../../../arm-none-eabi/bin/ld: /usr/src/arm-gnu-toolchain/bin/../lib/gcc/arm-none-eabi/13.3.1/../../../../arm-none-eabi/lib/thumb/v6-m/nofp/libc.a(libc_a-lseekr.o): in function `_lseek_r':lseekr.c:(.text._lseek_r+0x10): undefined reference to `_lseek'/usr/src/arm-gnu-toolchain/bin/../lib/gcc/arm-none-eabi/13.3.1/../../../../arm-none-eabi/bin/ld: /usr/src/arm-gnu-toolchain/bin/../lib/gcc/arm-none-eabi/13.3.1/../../../../arm-none-eabi/lib/thumb/v6-m/nofp/libc.a(libc_a-readr.o): in function `_read_r':readr.c:(.text._read_r+0x10): undefined reference to `_read'collect2: error: ld returned 1 exit statusCompiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.Compiler: /usr/src/arm-gnu-toolchain/bin/arm-none-eabi-g++ Build flags: ;-mcpu=cortex-m0plus;-mthumbId flags: The output was:1/usr/src/arm-gnu-toolchain/bin/../lib/gcc/arm-none-eabi/13.3.1/../../../../arm-none-eabi/bin/ld: /usr/src/arm-gnu-toolchain/bin/../lib/gcc/arm-none-eabi/13.3.1/../../../../arm-none-eabi/lib/thumb/v6-m/nofp/libc.a(libc_a-exit.o): in function `exit':exit.c:(.text.exit+0x16): undefined reference to `_exit'/usr/src/arm-gnu-toolchain/bin/../lib/gcc/arm-none-eabi/13.3.1/../../../../arm-none-eabi/bin/ld: /usr/src/arm-gnu-toolchain/bin/../lib/gcc/arm-none-eabi/13.3.1/../../../../arm-none-eabi/lib/thumb/v6-m/nofp/libc.a(libc_a-sbrkr.o): in function `_sbrk_r':sbrkr.c:(.text._sbrk_r+0xc): undefined reference to `_sbrk'/usr/src/arm-gnu-toolchain/bin/../lib/gcc/arm-none-eabi/13.3.1/../../../../arm-none-eabi/bin/ld: /usr/src/arm-gnu-toolchain/bin/../lib/gcc/arm-none-eabi/13.3.1/../../../../arm-none-eabi/lib/thumb/v6-m/nofp/libc.a(libc_a-writer.o): in function `_write_r':writer.c:(.text._write_r+0x10): undefined reference to `_write'/usr/src/arm-gnu-toolchain/bin/../lib/gcc/arm-none-eabi/13.3.1/../../../../arm-none-eabi/bin/ld: /usr/src/arm-gnu-toolchain/bin/../lib/gcc/arm-none-eabi/13.3.1/../../../../arm-none-eabi/lib/thumb/v6-m/nofp/libc.a(libc_a-closer.o): in function `_close_r':closer.c:(.text._close_r+0xc): undefined reference to `_close'/usr/src/arm-gnu-toolchain/bin/../lib/gcc/arm-none-eabi/13.3.1/../../../../arm-none-eabi/bin/ld: /usr/src/arm-gnu-toolchain/bin/../lib/gcc/arm-none-eabi/13.3.1/../../../../arm-none-eabi/lib/thumb/v6-m/nofp/libc.a(libc_a-lseekr.o): in function `_lseek_r':lseekr.c:(.text._lseek_r+0x10): undefined reference to `_lseek'/usr/src/arm-gnu-toolchain/bin/../lib/gcc/arm-none-eabi/13.3.1/../../../../arm-none-eabi/bin/ld: /usr/src/arm-gnu-toolchain/bin/../lib/gcc/arm-none-eabi/13.3.1/../../../../arm-none-eabi/lib/thumb/v6-m/nofp/libc.a(libc_a-readr.o): in function `_read_r':readr.c:(.text._read_r+0x10): undefined reference to `_read'collect2: error: ld returned 1 exit status
For the most part you can run Lua source you find online that only needs core libraries, you just need to pre-load them with uses. With the extra memory on the RP2350 it's not really as critical to save that little bit of memory.
I was thinking of a little user program maybe call it run or load it's purpose would be to load all the libraries and then call the code you want to try out. In that way you could take any code from online and it should if compatible work without modification. I did started something like to make a menu to load programs rather than type them in. Everything is in a crude state I've been more focused on the firmware at the moment.
Before I started the newlib porting I wouldn't have had a clue but now I know exactly what those are. Those are the system calls that would be needed to be defined to make the io work. Are these errors showing up on the regular builds? I don't have them defined in regular builds and as of yet still haven't figured out why the newlib stuff only works sometimes and not others.
You'll want to run this one from storage. but this is one for the other demos I have.
Code:
-- See original here http://www.a1k0n.net/2006/09/15/obfuscated-c-donut.htmluses("math")uses("string")uses("pt") A=0 B=0 z={}b= {}E={32,46,44,45,126, 58,59,61,33,42,35,36,64}S =math.sin C=math.cos F=math. floor I=pt.putchar T=string.char W=40 P=print H=24 P("\x1bJ") for w=1,240 do for o=0,W*H do b[o]=1 z[o]=0 end e= S(A)g=C(A)m=C(B)n=S(B)for j=0,6.28,.09 do d=C(j)f=S(j) for i=0,6.28,.04do c=S(i)h=d+2 D =1/(c*h*e+f*g+5)l=C(i)t=c*h*g- f*e x=F(W/2+W*.3*D*(l*h*m-t*n ))y=F(H/2+H*.6* D*(l*h*n+t*m))o =x+W*y N=math. max(0,F(8*((f*e-c*d*g)*m-c*d*e-f*g -l* d *n)))+2 if H> y and y>0 and x>0 and W>x and D> z[o] then z[o]=D b[o]=N end end end P( "\x1bH")for k=0 ,W* H do if k%W~=0 then I(T( E[b[k]])) else print () end end A = A + .04 B=B+.02 end
Statistics: Posted by DarkElvenAngel — Sun Dec 15, 2024 2:34 pm