wishlist for NXC

Discussion specific to NXT-G, NXC, NBC, RobotC, Lejos, and more.
HaWe
Posts: 2500
Joined: 04 Nov 2014, 19:00

Re: wishlist for NXC

Post by HaWe »

for a terminal connection one would probably need a host (like a PC) but I never use any host, all I'm doing is for autonomous running.
But for that a real keyboard would be fine to have (a commercial adapter PS/2 to i2c at best).

(admittedly OT as it is no NXC wish)
schodet
Posts: 139
Joined: 29 Sep 2010, 11:21
Contact:

Re: wishlist for NXC

Post by schodet »

pepijndevos wrote: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.
I suppose this can be done with messages, with a program receiving messages posted by the NXT program.
LEGO things http://ni.fr.eu.org/lego/ - NXT Improved Firmware (GCC) http://nxt-firmware.ni.fr.eu.org/ - Other robots http://apbteam.org
afanofosc
Site Admin
Posts: 1256
Joined: 26 Sep 2010, 19:36
Location: Nashville, TN
Contact:

Re: wishlist for NXC

Post by afanofosc »

BricxCC recently added a terminal window. I just need to add support for the NXT to this terminal window and then it will read and display whatever is sent by the NXT out its active connection (either USB or Bluetooth). Currently the terminal window only works with the HiTechnic SuperPro board.

John Hansen
Multi-platform LEGO MINDSTORMS programming
http://bricxcc.sourceforge.net/
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: wishlist for NXC

Post by mattallen37 »

~ John, I saw that, and that's what gave me hope you would add NXT support to it ;)
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
HaWe
Posts: 2500
Joined: 04 Nov 2014, 19:00

Re: wishlist for NXC

Post by HaWe »

would it be possible to have ButtonPressed just with 1 parameter like
while(ButtonPressed (BTNLEFT));

having always to add true or false is too much to write and it's enough to read the related button state.
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: wishlist for NXC

Post by mattallen37 »

Like my Buttons library?
Buttons.nxc
(592 Bytes) Downloaded 352 times
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
HaWe
Posts: 2500
Joined: 04 Nov 2014, 19:00

Re: wishlist for NXC

Post by HaWe »

Code: Select all

#define btn(b) ButtonPressed(b, false)
edit: yes, works.

edit2:
my btn lib:

Code: Select all

/******************************************************************************/
#define btn(b) ButtonPressed(b, false)
/******************************************************************************/

/******************************************************************************/
inline bool btnhit(){  // test if any btn is hit
/******************************************************************************/
   char test;
   test=( ButtonPressed(BTN1, false) || ButtonPressed(BTN2, false)
       || ButtonPressed(BTN3, false) || ButtonPressed(BTN4, false));
   return test;
}


/******************************************************************************/
inline char btnin() {  // read btn continuously (like cin <iostream>)
/******************************************************************************/
  char result = -1;

    if (ButtonPressed(BTNCENTER, false))
      result = BTNCENTER;
    else if (ButtonPressed(BTNEXIT, false))
      result = BTNEXIT;
    else if (ButtonPressed(BTNLEFT, false))
      result = BTNLEFT;
    else if (ButtonPressed(BTNRIGHT, false))
      result = BTNRIGHT;

    return result;
}
HaWe
Posts: 2500
Joined: 04 Nov 2014, 19:00

Re: wishlist for NXC

Post by HaWe »

I would really love to have a new, more stable BlueTooth protocol.
The fw-integrated version is just a mess: it often hangs, blocks, and drops messages - it's simply frustrating, sometimes it works, then it failes intermediately, then it works again, unreliable as anything.
The new protocol should be multithreading-safe for indpendend send to/receive from mailboxes of different NXT BT clients and should have integrated error checking (fast but simple, e.g. by checksums).

It should be possible to poll by the master all remote sensors and control all remote motors by similar commands like we have for the local I/Os.
mcsummation
Posts: 220
Joined: 23 Jan 2012, 17:07
Location: Round Rock, TX

Re: wishlist for NXC

Post by mcsummation »

mattallen37 wrote:Like my Buttons library?
Buttons.nxc
I picked up your little library and really like the Bump(). Saves a lot of typing on my part. :roll:
HaWe
Posts: 2500
Joined: 04 Nov 2014, 19:00

Re: wishlist for NXC

Post by HaWe »

looking for support for code like

Code: Select all

int turn;
string s;
task main() {
  s=turn==8?"white":"black";

  printf("test1: %s", s);
  wait(2000);
  ClearScreen();
  printf("test2: %s", turn==8?"white":"black");
  
  while(1);
}
Last edited by HaWe on 17 Oct 2012, 15:59, edited 1 time in total.
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests