Page 18 of 25

Re: wishlist for NXC

Posted: 09 Feb 2012, 10:24
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)

Re: wishlist for NXC

Posted: 11 Feb 2012, 15:40
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.

Re: wishlist for NXC

Posted: 11 Feb 2012, 17:45
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

Re: wishlist for NXC

Posted: 11 Feb 2012, 18:55
by mattallen37
~ John, I saw that, and that's what gave me hope you would add NXT support to it ;)

Re: wishlist for NXC

Posted: 15 Feb 2012, 20:18
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.

Re: wishlist for NXC

Posted: 15 Feb 2012, 22:12
by mattallen37
Like my Buttons library?
Buttons.nxc
(592 Bytes) Downloaded 352 times

Re: wishlist for NXC

Posted: 16 Feb 2012, 17:25
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;
}

Re: wishlist for NXC

Posted: 18 Feb 2012, 16:38
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.

Re: wishlist for NXC

Posted: 18 Feb 2012, 17:33
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:

Re: wishlist for NXC

Posted: 21 Feb 2012, 00:56
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);
}