To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.nqcOpen lugnet.robotics.rcx.nqc in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / NQC / 1747
1746  |  1748
Subject: 
Re: Swan Firmware
Newsgroups: 
lugnet.robotics.rcx.nqc
Date: 
Sun, 6 Feb 2005 22:51:26 GMT
Viewed: 
6243 times
  
In lugnet.robotics.rcx.nqc, Iain Hendry wrote:
But I can't
figure out how to use this SetUserDisplay command?  I want to show a
variable on the display.  I have no idea how to do that?

Also the delay thing.  If I just put in Wait (1) will it now wait 1/1000
instead of 1/100?

Having downloaded a copy of swan_test.zip which contains the latest test release
of BricxCC and NQC you can use nearly all the new and enhanced features in the
Swan firmware.  You can view the "official" API built into NQC by executing the
following command line:

nqc -api > api.nqh

This file can be loaded into BricxCC and you can use the Procedure List and the
Code Explorer to browse through the file looking at all the various constants
and functions.  Most of the new Swan API is near the very end of the file within
a #if defined(__SWAN) section.

The 1 ms timer routines are defined as follows:

  #define MSTimer(n) @(0x160000 + (n))
  __nolist void ResetMSTimer(const int n) { Set(MSTimer(n), 0); }

  __nolist void WaitMS(const int &v) { asm { 0x47, $v : __ASM_SRC_EXT}; }


So if you want to use the 10 millisecond wait you use Wait(n) and if you want to
use the 1 millisecond wait you use WaitMS(n).  If you want to read the 10ms
timer you use FastTimer(n).  If you want to read the 100ms timer you use
Timer(n).  If you want to read the 1ms timer you use MSTimer(n).

task main()
{
  int x = 1;
  for (x = 0; x < 100; x++)
  {
    SetUserDisplay(x, DISPLAY_USER);
    WaitMS(1000);
  }
}

This short program will update the display with the value of variable x one time
each second.

John Hansen



Message has 1 Reply:
  Re: Swan Firmware
 
(...) Um. I have no idea what an API is :-/ (...) Oh my god. I'm completly lost :( (...) Whaaa?? (...) When I copy/paste that into BricxCC, I get an when I hit the Compile/download button: Undefined function: "SetUserDisplay"...?? I think I'm going (...) (20 years ago, 7-Feb-05, to lugnet.robotics.rcx.nqc)

Message is in Reply To:
  Re: Swan Firmware
 
Okay, okay, bad form responding to my own post. I got the new firmware on my RCX, downloaded the latest version of BricxCC, and NQC. But I can't figure out how to use this SetUserDisplay command? I want to show a variable on the display. I have no (...) (20 years ago, 6-Feb-05, to lugnet.robotics.rcx.nqc)

23 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
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR