New BricxCC and NBC/NXC release

Discussion specific to NXT-G, NXC, NBC, RobotC, Lejos, and more.
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: New BricxCC and NBC/NXC release

Post by mattallen37 »

I seem to be able to open it perfectly with the release from last summer (3.3.8.7). However, this program won't open without crashing that release.

Code: Select all

#define SHORT_WAIT 3                //short wait for value to stabilize

int A,B,C,E,AF,BF,CF,EF,Final;                             //global

task main()
{

  SetUserDisplay (Final,0);
  SetSensor (SENSOR_1, SENSOR_TOUCH);
  Wait (100);
  SetSensor(SENSOR_1, SENSOR_LIGHT);    //power on sensor by making it light type
  SetSensorType (SENSOR_2, SENSOR_TYPE_TOUCH);
  while (true)                      //loop forever
  {
    if (SENSOR_1== 100)
  {
        SetSensor(SENSOR_1, SENSOR_TOUCH);
        SetSensor(SENSOR_1, SENSOR_LIGHT);
        Wait(SHORT_WAIT);
   }


    A = SENSOR_1*1;                   //read the A and scale by 1

    SetSensor(SENSOR_1, SENSOR_TOUCH);  //toggle power to change to channel 2
    SetSensor(SENSOR_1, SENSOR_LIGHT);
    Wait(SHORT_WAIT);
    B = SENSOR_1*1;                   //read the B and scale by 1

    SetSensor(SENSOR_1, SENSOR_TOUCH);  //toggle power to change to channel 3
    SetSensor(SENSOR_1, SENSOR_LIGHT);
    Wait(SHORT_WAIT);
    C = SENSOR_1*1;                   //read the C and scale by 1

    SetSensor(SENSOR_1, SENSOR_TOUCH);  //toggle power to change to channel 0
    SetSensor(SENSOR_1, SENSOR_LIGHT);

    if (A == 0) { AF = 0; }
    else{ AF = 1; }

    if (B == 0) { BF = 0; }
    else { BF = 10; }

    if (C == 0) { CF = 0; }
    else{ CF = 100; }

    EF = 1000;
    Final = AF + BF + CF + EF;
  }

}


I have the programs saved as .nqc files. When I go to open a program, the default type is NXC, so I have to click on the dropdown menu and select NQC. Yes I did recently change to tabbed mode. Should I switch back to MDI and see what happens?
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
muntoo
Posts: 834
Joined: 01 Oct 2010, 02:54
Location: Your Worst Nightmare
Contact:

Re: New BricxCC and NBC/NXC release

Post by muntoo »

afanofosc wrote:You did recently switch from MDI mode to tabbed mode, didn't you?
10 Days, 23 Hours, and 52 minutes ago.

Muntoo "still trying to win next year's prolific poster award" ;)
Image

Commit to LEGO Mindstorms Robotics Stack Exchange:
bit.ly/MindstormsSE


Commit to LEGO Stack Exchange: bit.ly/Area51LEGOcommit
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: New BricxCC and NBC/NXC release

Post by mattallen37 »

muntoo wrote:...Muntoo "still trying to win next year's prolific poster award" ;)
LOL

Keep trying, and the banhammer will swing for the first time (I think first anyhow) :lol:
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: New BricxCC and NBC/NXC release

Post by mattallen37 »

Okay,I switched to MDI mode, and so far so good (tried with both versions of BCC). I opened 20 programs (that's all I have on this computer so far), and it didn't crash once :D Hopefully my success won't be short-lived.
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
slavkozn
Posts: 24
Joined: 04 Oct 2010, 19:35
Contact:

Re: New BricxCC and NBC/NXC release

Post by slavkozn »

afanofosc wrote:I will correct the source archive.
OK, thanks

Edit: i was success, the packages uploaded in my repo (http://slavino.sk/ulozisko-apt) for both (i386, amd64) archs.
schodet
Posts: 139
Joined: 29 Sep 2010, 11:21
Contact:

Re: New BricxCC and NBC/NXC release

Post by schodet »

Hello,

Thanks for including absolute regulation!

Here is some precision about questions I have seen:

About SetMotorRegulationTime: this can be used to change the interval between regulation update. You really should reduce it to 10 ms to use absolute regulation. More details.

About SetMotorRegulationOptions: this provides advanced control on the control loop. The default firmware code will limit P term and I term of the PID algorithm to 50 % of the output power. If you want a pure P control loop for example, this is not optimal. Using the OUT_REGOPTION_NO_SATURATION options, the limit is removed and you can reach full motor power with only the P part.

About MaxSpeed: this is between 0 and 100. 0 is a special value which means "no limit, no speed control".

About MaxAcceleration: this is also between 0 and 100. 0 is a special value which means "no acceleration control, always use max speed". For any other value, MaxSpeed should be set. You will usually use small Acceleration values or else the effect will be unnoticed.

There is a tutorial here.
LEGO things http://ni.fr.eu.org/lego/ - NXT Improved Firmware (GCC) http://nxt-firmware.ni.fr.eu.org/ - Other robots http://apbteam.org
Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 22 guests