Code: Select all
#define STRING(x) #x
TextOut(0,0,STRING(__LINE__),0);
Code: Select all
#define STRING(x) #x
TextOut(0,0,STRING(__LINE__),0);
Yeah, I'd like that fixed too. One way could be to create a "new window", then load the NeXTExplorer/etc inside it.cghaning wrote:I find it frustrating that the items on the tools menu (i.e. Diagnostics, Send Messages, Nxt Explorer, etc...) get caught behind the editor and at least for the Windows version you can't alt-tab to bring it back to the foreground. I end up having to click twice on the tools menu to get the tool back.
You need to advertise it, or not many will notice. Also, even if someone finds it, they may not know how to use it. The examples could use some work. Maybe you could set up a topic in which people can submit sample code/etc for the help files?afanofosc wrote:I'm glad to see someone using the file seek ability that I added to the enhanced firmware. Have you used it in other programs? Does it appear to work correctly in all the cases where you have used it?
Code: Select all
bool ButtonPressed(const byte btn, bool resetCount)
Code: Select all
bool ButtonPressed(const byte btn, bool resetCount = false)
Code: Select all
bool resetCount
Code: Select all
char ButtonPressed();
Code: Select all
char BtnValue=ButtonPressed(); // assigns the code of the specific Btn which is pressed
if (ButtonPressed()== Btn1) // asks if just Btn1 is pressed
if (ButtonPressed()) // asks if ANY a Btn is pressed
Code: Select all
void ButtonResetCount(const byte btn);
Code: Select all
char getchar()
Code: Select all
Button ScanCode
btn[1] = 1
btn[2] = 2
btn[3] = 4
btn[4] = 8
Code: Select all
char ButtonLongPressed();
You're right. I didn't realize I posted on the wrong thread. Oh well, no going back now (unless a admin helps out or something).doc-helmut wrote: ps:
@admins:
both muntoo's post and my widening one are actually NXC issues, not Bricxcc issues. Maybe you can move them to the NXC wishlist if you wish
Code: Select all
/* Program Name: "GetButtonDirection.nxc"
** This program was created by "muntoo" on December 18, 2010
** Created using BricxCC (by John Hansen) and written in NXC (by John Hansen)
** ( http://bricxcc.sourceforge.net/ )
Description:
A way of calling ButtonPressed() safely (for multiple threads).
*/
#ifndef __GETBUTTONDIRECTION_NXC__
#define __GETBUTTONDIRECTION_NXC__
#define GETBUTTONDIRECTIOM_SAFECALL
#ifdef GETBUTTONDIRECTIOM_SAFECALL
safecall inline byte GetButtonDirection(bool resetCount = false)
#else
inline byte GetButtonDirection(bool resetCount = false)
#endif
{
/*
From NXC Programmer's Guide:
BTN1, BTNEXIT 0
BTN2, BTNRIGHT 1
BTN3, BTNLEFT 2
BTN4, BTNCENTER 3
NO_OF_BTNS 4
*/
// return((ButtonPressed(BTNCENTER, resetCount) << BTNCENTER) | (ButtonPressed(BTNLEFT, resetCount) << BTNLEFT) | (ButtonPressed(BTNRIGHT, resetCount) << BTNRIGHT) | ButtonPressed(BTNEXIT, resetCount)); // (ButtonPressed(BTNEXIT, resetCount)) << BTNEXIT)
return((ButtonPressed(BTN4, resetCount) << BTN4) | (ButtonPressed(BTN3, resetCount) << BTN3) | (ButtonPressed(BTN2, resetCount) << BTN2) | ButtonPressed(BTN1, resetCount)); // (ButtonPressed(BTN1, resetCount)) << BTN1)
}
inline bool ButtonDirectionPressed(byte ButtonDirection, byte btn)
{
/*
From NXC Programmer's Guide:
BTN1, BTNEXIT 0
BTN2, BTNRIGHT 1
BTN3, BTNLEFT 2
BTN4, BTNCENTER 3
NO_OF_BTNS 4
*/
return(((ButtonDirection >> btn) & 0x01) != 0);
}
#endif
Users browsing this forum: No registered users and 0 guests