wishlist for NXC
Re: wishlist for NXC
as meanwhile the nxcdefs.h has grown big enough to sink the whole Royal Navy^^ i would appreciate if we could get more distinct header files, e.g.
stdlib.h (including stdio.h., conio.h, stdlib.h: display, button, and file io, math, array, and strings calculation/manipulation/statistics)
sensors.h
motors.h
comm.h (for BT and rs485 and i2c)
stdlib.h (including stdio.h., conio.h, stdlib.h: display, button, and file io, math, array, and strings calculation/manipulation/statistics)
sensors.h
motors.h
comm.h (for BT and rs485 and i2c)
Last edited by HaWe on 07 Mar 2012, 20:45, edited 2 times in total.
-
- Posts: 175
- Joined: 28 Dec 2011, 13:07
- Location: Gelderland, Netherlands
- Contact:
Re: wishlist for NXC
John, you are awesome! I can't wait to play with them. So you even managed to do variable jumps? I'm sorry I can't do Pascal, because I'd want this sooner rather than later. Is there any low-hanging fruit I could help with?
I guess you also made Doc really happy, but apparently he doesn't realize yet.
I guess you also made Doc really happy, but apparently he doesn't realize yet.
-- Pepijn
http://studl.es Mindstorms Building Instructions
http://studl.es Mindstorms Building Instructions
Re: wishlist for NXC
no, actually not. when? what? why?I guess you also made Doc really happy, but apparently he doesn't realize yet.
Re: wishlist for NXC
Doc realizes it but he just hasn't realized that he has yet. In any case, he can draw text to any Y value now without resorting to RIC fonts and he can use super-fast string uppercase and lowercase functions. If you have any suggestions for additional array operations that are specific to strings (like uppercase and lowercase) let me know.
Since I'm home sick with a cold I've been working on the compiler changes for variable jumps et al. I just need to sort out how to get the set opcode to work with either a Clump name or a Label name and I should be good to go. The main problem is both of these are optimized a ton so I can't swap out the name for a constant until after all the optimizations are done. And I also need to make sure I include these clump names and label names in the code that builds up a list of references so that I don't optimize out a clump that is referred to in a set opcode. Until I get these changes made you won't be able to do much with the firmware support that is already in place. Hopefully by the end of the day it will be all ready to go.
John Hansen
Since I'm home sick with a cold I've been working on the compiler changes for variable jumps et al. I just need to sort out how to get the set opcode to work with either a Clump name or a Label name and I should be good to go. The main problem is both of these are optimized a ton so I can't swap out the name for a constant until after all the optimizations are done. And I also need to make sure I include these clump names and label names in the code that builds up a list of references so that I don't optimize out a clump that is referred to in a set opcode. Until I get these changes made you won't be able to do much with the firmware support that is already in place. Hopefully by the end of the day it will be all ready to go.
John Hansen
Multi-platform LEGO MINDSTORMS programming
http://bricxcc.sourceforge.net/
http://bricxcc.sourceforge.net/
Re: wishlist for NXC
it was actually only because I was curious about these 2 issues:
1) print(x,y) anywhere without grafic ric fonts
2) upper/lower string.
for 1) I was using ric fonts (especially with smaller fonts 6x7, 5x6) so far and
for 2) it was only for a small programming idea of a palindrom check program, not for any ongoing need; but this once might become important if we once had a real commercial PC keyboard which could be attached by i2c or BT.
much more really useful to have would be
3) a really full ANSI compatible print/printf for multiple variables of any kind of type supporting also functions as parameters.
and this combined
4) with a cursor(x,y) cmd:
1) print(x,y) anywhere without grafic ric fonts
2) upper/lower string.
for 1) I was using ric fonts (especially with smaller fonts 6x7, 5x6) so far and
for 2) it was only for a small programming idea of a palindrom check program, not for any ongoing need; but this once might become important if we once had a real commercial PC keyboard which could be attached by i2c or BT.
much more really useful to have would be
3) a really full ANSI compatible print/printf for multiple variables of any kind of type supporting also functions as parameters.
Code: Select all
task main()
{
printf ("Characters: %c %c \n", 'a', 65);
printf ("Decimals: %d %ld\n", 1977, 650000L);
printf ("Preceding with blanks: %10d \n", 1977);
printf ("Preceding with zeros: %010d \n", 1977);
printf ("Some different radixes: %d %x %o %#x %#o \n", 100, 100, 100, 100, 100);
printf ("floats: %4.2f %+.0e %E \n", 3.1416, 3.1416, 3.1416);
printf (upper("Width trick")+": %*d \n", 5, 10);
printf ("%s \n", lower("A string"));
return 0;
}
4) with a cursor(x,y) cmd:
Code: Select all
void cursor( short x, short y ) {
COORD position = { x, y };
//...
SetConsoleCursorPosition( hStdout, position );
}
cursor(5, 7); printf (upper("Width trick")+": %*d", 5, 10);
cursor(5,17); printf ("%s \n", lower("A string"));
-
- Posts: 1818
- Joined: 02 Oct 2010, 02:19
- Location: Michigan USA
- Contact:
Re: wishlist for NXC
~Helmut, can't you use sprintf? Or do you want it to be terminal style, where you write to the screen, and it writes to the bottom, and moves up as necessary? I am working on an NXC library for that, that supports RIC fonts. It already works well, but it isn't as fast as I want it to be. I am currently converting it to use NBC for some of the drawing, and already increased speed over 40% (with the test program).
That reminds me of my wish for a terminal for the NXT. I want a way that an NXT running an NXC program can send a debug stream to the computer, and have it displayed (like a serial terminal). I think I already mentioned this in the BCC wishlist.
That reminds me of my wish for a terminal for the NXT. I want a way that an NXT running an NXC program can send a debug stream to the computer, and have it displayed (like a serial terminal). I think I already mentioned this in the BCC wishlist.
Matt
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
Re: wishlist for NXC
matt,
I already have single printf for 1, 2, or three definite variables but not "overloaded" to use printf for any number of variables with just 1 format string, and not always for any number of "\"
( just like I showed in my examples, and it doesn't work with expressions).
The cursor function is not original C but it's in some windows C libraries.
I never used sprintf so far, what's the difference to printf?
I already have single printf for 1, 2, or three definite variables but not "overloaded" to use printf for any number of variables with just 1 format string, and not always for any number of "\"
( just like I showed in my examples, and it doesn't work with expressions).
The cursor function is not original C but it's in some windows C libraries.
I never used sprintf so far, what's the difference to printf?
-
- Posts: 1818
- Joined: 02 Oct 2010, 02:19
- Location: Michigan USA
- Contact:
Re: wishlist for NXC
You can use sprintf to format numbers. You give it a string to write to, a string that includes a formatter, and a number to format. It doesn't display anything, it just writes the info into the output string (so you can do whatever you want with it). I don't know if it supports multiple formatters and numbers though (for which there are obviously workarounds).
Matt
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
Re: wishlist for NXC
ok, I see.
But I need printf only to display but with multiple formatters and for any number of and kind of variables (char, int, long, float, string).
Workarounds I already have.
But I need printf only to display but with multiple formatters and for any number of and kind of variables (char, int, long, float, string).
Workarounds I already have.
-
- Posts: 175
- Joined: 28 Dec 2011, 13:07
- Location: Gelderland, Netherlands
- Contact:
Re: wishlist for NXC
What Matt said(I think). One thing I really liked about pbLua is the terminal connection. Direct commands are nice, but limited. I wonder if it can be done with NBC hacking, or needs a special firmware.
-- Pepijn
http://studl.es Mindstorms Building Instructions
http://studl.es Mindstorms Building Instructions
Who is online
Users browsing this forum: No registered users and 1 guest