Subject:
|
Re: BricxCC news
|
Newsgroups:
|
lugnet.robotics
|
Date:
|
Fri, 24 Nov 2006 14:15:50 GMT
|
Viewed:
|
4227 times
|
| |
| |
John, THANK YOU so much for this.
I cant wait to have a few minuites to myself (sans wife/kids/work) so I can
download and play.
if I grok your C code fragments for NXT via BrickCC, then I just might have a
programmed robot yet.
Thank you for your efforts.
Chris
i guess begging for you to stop all the other stuff to focus 100% HansenNXTbasic
aka HNB would be too much to ask? (grin)
10 Print clr
15 T = 0
20 power A 100
30 motor A on
40 for t = 1 to 1000
50 off A
60 goto 30
I can dream cant i? :)
In lugnet.robotics, John Hansen wrote:
> I recently updated the test release of BricxCC with additional support for the
> NXT. In conjunction with the latest beta of NBC you can now write programs that
> target the standard NXT firmware in three different text-based programming
> languages. NBC continues to grow its library of API macros which significantly
> simplify writing programs. Playing a file, for instance, is as simple as
> calling the PlayFile macro function like so:
>
> PlayFile('mysound.rso') // play a sound file
>
> or
>
> PlayFile('mymelody.rmd') ; play a melody file
>
> BricxCC now includes support for a very simple 5-line declarative programming
> language called NPG which lets you write, compile, download, and run simple NXT
> Programs using a text language. The commands that can be used in an NPG 5-line
> program are EmptyMove, Forward, ForwardFive, BackLeftTwo, TurnLeft, TurnLeftTwo,
> BackRight, TurnRight, TurnRightTwo, BackLeft, PlayToneOne, PlayToneTwo,
> Backward, BackwardFive, BackRightTwo, EmptyWait, WaitForLight, WaitForObject,
> WaitForSound, WaitForTouch, WaitTwoSeconds, WaitFiveSeconds, WaitTenSeconds,
> WaitForDark, EndLoop, and EndStop. RPG programs require the RPGReader.sys
> executable to be installed on the NXT. The original RPGReader.sys NXT program
> is ~14.3kb in size. A smaller RPGReader.sys replacement can be downloaded from
> the NBC samples page. This replacement implements a very similar functionality
> as exists in the original RPGReader.sys but it is only ~2.5kb in size. The NXT
> Explorer in BricxCC can execute and stop RPG programs now as well.
>
> BricxCC also now supports a very early test release of the NXC programming
> language. NXC is built into the NBC compiler. It is extremely limited at
> present, but it will develop rapidly over the next few weeks. Here are a few
> sample NXC programs:
>
> #include "NXCDefs.h"
>
> int move_time, turn_time;
>
> task main()
> {
> while(TRUE)
> {
> move_time = 6000;
> turn_time = 4000;
> // move_time = Random(600);
> // turn_time = Random(400);
> OnFwd(OUT_AC, 75);
> Wait(move_time);
> OnRev(OUT_A, 75);
> Wait(turn_time);
> }
> }
>
>
> -----------------------------------------------------
>
> #include "NXCDefs.h"
>
> task main()
> {
> OnFwd(OUT_A, 75);
> OnFwd(OUT_B, 75);
> Wait(4000);
> OnRev(OUT_AB, 75);
> Wait(4000);
> Off(OUT_AB);
> }
>
> ----------------------------------------------------
>
> int x, y, z;
> bool p, d, q;
> mutex myMutex;
> char c;
> unsigned short s;
>
> sub Weird()
> {
> Write(z);
> }
>
> task main()
> {
> x=-130;
> // z = 10;
> z = 40+(10-16)/3;
> while (x < 10)
> {
> /*
> z += 2;
> */
> Weird();
> z -= 4;
> if (0) { continue; }
> Wait(500);
> x++;
> }
>
> Cls();
>
> s = 500;
> Wait(s+500);
>
> for (z=0; z < 10; z++)
> {
> Weird();
> if (z < 0) {
> break;
> }
> Wait(500);
> }
>
> Wait(3000);
> }
>
>
> BricxCC also has improved support for the NXT via its main Watch window and the
> NXT Explorer window now supports dropping files from any explorer window on the
> NXT pane.
>
> John Hansen
> http://bricxcc.sourceforge.net/
|
|
Message is in Reply To:
| | BricxCC news
|
| I recently updated the test release of BricxCC with additional support for the NXT. In conjunction with the latest beta of NBC you can now write programs that target the standard NXT firmware in three different text-based programming languages. NBC (...) (18 years ago, 21-Nov-06, to lugnet.robotics)
|
2 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
Active threads in Robotics
|
|
|
|