Subject:
|
Re: Attention please: Swan Problem demi-solved!
|
Newsgroups:
|
lugnet.robotics.rcx.nqc
|
Date:
|
Thu, 21 Jul 2005 21:42:06 GMT
|
Viewed:
|
5658 times
|
| |
| |
In lugnet.robotics.rcx.nqc, Daniele Benedettelli wrote:
> I tried to use files included in OLD test_swan.zip and RCX don't throw exception
> 40 no more!
> Then I tried a program with #include "swan.nqh" with latest NQC version and
> RCX throws exception no.5!
>
>
> To Dick Swan:
>
> NQC API is changed from old test_swan and new one?
>
> With new NQC.exe(about 400Kb) I still need to include swan.nqh?
>
> Thank you, your job is precious!
Quite possibly you have an old version of the Swan firmware. My copy is called
fast0103.lgo dated 2005-01-13. Dick sent me an updated version back then when I
was working on the NQC API for his firmware. I don't know if it is available
publically.
This code:
task main()
{
SetMotorPower128(MTR_A,100);
SetOutput(OUT_A,OUT_FLOAT);
Wait(300);
Off(OUT_A);
}
compiles, downloads, and runs correctly on the fast0103.lgo Swan firmware.
The SetOutput and Off commands do not use the MTR_A style constants that were
added as part of the Swan API changes. Those two commands use the OUT_A, OUT_B,
etc... constants. The documentation makes that perfectly clear. Also,
SetOutput does not use the OUT_REV constant. That constant is for use by the
SetDirection command. It just so happens that OUT_REV == OUT_FLOAT so you got
lucky that the constant was not an invalid value for that API function. Again,
all of this is in the documentation included with BricxCC.
You can write code like this:
task main()
{
SetMotorPower128(MTR_A,100);
}
or you can write code like this:
task main()
{
MotorPower128(MTR_A) = 100;
}
These two compile to exactly the same bytes.
John Hansen
|
|
Message has 1 Reply:
Message is in Reply To:
| | Attention please: Swan Problem demi-solved!
|
| I tried to use files included in OLD test_swan.zip and RCX don't throw exception 40 no more! Then I tried a program with #include "swan.nqh" with latest NQC version and RCX throws exception no.5! To Dick Swan: NQC API is changed from old test_swan (...) (19 years ago, 20-Jul-05, to lugnet.robotics.rcx.nqc)
|
3 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
This Message and its Replies on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|