Quite C.

[ Lego ]

Introduction
What's new
Projects
Install
Writing code
Downloading code
Notes
Version history
Files
Example

 

 The new LCDPrints(" HELLO");

 

 Look details! What you can do with the new version (1.03) of Visor & help of good setup (light.c)

INTRODUCTION 

Quite C is intended to be a repackaging and reordering of a miniOS (no multitasking!) for the Lego RCX. It provides an interface between your C code and the ROM. The intent is to allow you to write very large programs in C language (neural and pathfinder programs like) with Microsoft Windows platform. LegOS is too Unixish ;) Quite C is distributed under the Mozilla Public License. Please see the file LICENSE for details.You can find Quite C here: http://digilander.iol.it/ferrarafrancesco/lego/qc/

WHAT'S NEW

  • Andy Clapham new Project with QC: Speech
    With its programs it is possible to play some speech wav
  • Mario and Giulio Ferrari have a new book out for only $19.95 (21.60)
    Building Robots with Lego Mindstorms
    It IS a fantastic book as it mentions this site. Actually Mario was kind enough to send me the pre-release ebook version and it's an excellent book, with details of lots of different types of robots, general building hints, and all sorts of other information which will really spark your imagination when thinking "What can I build now". It is focused on building robot parts. It is not intended for hardcore programmers (like the one that use QC :)) but you can find ideas for the mechanical parts and some maths involved.
    Click on the image to the right to get more details from the publisher's website.
  • Andy Clapham new Project with QC: 4-in-a-Robot
    It is a robot that play 4-in-a-row
  • Andy Clapham new Project with QC: Chess
    A complete Chess (REAL!) program
  • Updated the win-h8-egcc cross compiler download site!
  • New Version 1.05 Quite C
  • New page style

PROJECTS

  • Visor - A simple LEGO camera robot with the help of Visual Basic 6 build a .TGA picture file.
  • TAR - Tactical robot, play (very well) connect-3, a complex board game (really). The software that you must download into the robot use a complex minmax search tree with 5 level depth analysis (look 4 move ahead!!!). The most complex game made with lego!

INSTALL

You must download H8 compiler and the libs, Unzip the compiler into C:\QUITE C\ directory and set path (use env.bat as an example) to C:\QUITE C\BIN directory. You can now go to demo dir and compile some examples.

WRITING CODE

The code in C:\QUITE C\DEMO\ show some examples of how to use the routines I provide; for the most part, you will want to interface with the RCX using the routines defined and described in C:\QUITE C\INCLUDE\QC.H. These routines are documented to some degree at: http://graphics.stanford.edu/~kekoa/rcx/#Rom.

DOWNLOADING CODE

To download a .srec file to the RCX, Run download.bat with a filename (without extension) compile before with qc (no ext). DO NOT USE EXTENSION LIKE .SREC OR .C

Sorry, but download.bat support only COM1 for IR Tower. You can use NQC to download at 4x speed and with other COM ports.

NOTES

This program is not sponsored, authorized, or even endorsed by the LEGO Group. Do not associate this code with the LEGO Group, there is no such association.

If you find problems with QUITE C, of course I'd like to know about them; however, I may or may not have the time to address any issues brought to my attention. My apologies in advance.

VERSION HISTORY

1.05

  • PowerOff now works! You can use PowerOff to freeze your RCX in the current state (saving batteries), RCX resume in the exact point of interrupt! You can now maintain your program in memory.
  • srand now works with small value, so you can write something like:
    srand(TimerGet(0)) to have a series of rand values
  • Added TAR 2.0 to the qc package

1.04

  • Added reference.txt that contain all command built into QuiteC libs
  • Changed some define & added new into qc.h
  • Corrected some demos that use old API LCDPrint into LCDPrintn
  • Added new API rand
  • I have tested & approved the new LCDPrints that can print 5 char into 7-segments LCD display of your RCX!!!

1.03

  • I have separated the compiler from QuiteC and you can find the correct link to get it
  • You can now setup your light sensor with light.c
  • Modification to Visor.c (better contrast & more resolution)

1.02

  • fixed and changed API Range into IRLong, IRShort
  • fixed IRPrintn with n==0
  • changed name of LCDPrint into LCDPrintn
  • added a demo (Visor) that can transform your RIS into a PhotoCamera!!!

1.01

  • IROn IROff names are corrected rewritten in C
  • IRSend IRReceive IRReady are now taken adapted from pbForth.
  • Some new note in files.
  • IRPrintn is now negative number compliant! ;)
  • added LCDPrints that print a 5-6 char string to the 7-segment display!!!
  • changed qc.bat that now compile with all warning optimizations

1.0

  • First Release

FILES

EXAMPLE

This is a simple piece of code to demo what you can write with QuiteC:

#define XMAX 80
#define YMAX 150
// this can be done only into QUITE C
// this is VERY large array!!!
char light[YMAX][XMAX];
int 
main ()
{
  int x, y, l, c;
  SetSensor (EYE, SENSOR_TYPE_LIGHT, SENSOR_MODE_RAW);
  SensorActive (EYE);
  getc();
  PlaySound(0);
      
  for (x = 0; x < XMAX; x++)
    {
      LCDPrintn (x);
      if ((x%10)==0) PlaySound(1);
      // move right with a 2/100 sec. step
      MotorSet (4, FWD, SXMOTOR);
      MotorSet (4, REV, DXMOTOR);
      Wait (2);
      MotorSet (7, BRK, SXMOTOR);
      MotorSet (7, BRK, DXMOTOR);
      
      // Move the light sensor down to the blocking position
      // adding 5/100s to the correct time
      MotorSet (1, DOWN, EYEMOTOR);
      Wait (YMAX + 5);
  

[ Lego | Introduction | What's new | Projects | Install | Writing code | Downloading code | Notes | Version history | Files | Example ]