Advanced Robocamps Code Archive
All the code presented during the Advanced Robocamps course is written
in TEA which is a subset of ANSI C. Complete documentation of the TEA
programming language can be found at the Acroname
website. This language is continuously being improved on a bi-monthly
basis.
The following is by no means a complete documentation of TEA.
This is simply a shortened list of code used during Advanced Robocamps.
Code used during Advanced Robocamps
Commonly Used Syntax
You may select some code from the drop down menu or scroll down the page.
This snippet tells the SP03 to say "Talking is fun".
Parameters used are:
VOLUME - 0 - 7 (7 is the lowest volume)
PITCH - 0 - 7 (7 is the lowest pitch)
SPEED - 0 -3 (3 is the fastest)
This snippet checks the Sensor attached to channel 0 to see if
it is greater then 400. If it is, then it turns off the motors on
a 2WD differential robot and then waits for 1 second. Otherwise,
when the sensor reading is below 400, the 2WD robot moves forward.
if (aA2D_ReadInt(0) >= 400) {
aMo_Go(0,0);
aCore_Sleep(10000);
}
You can also do the following:
if (aA2D_ReadInit(1) <= 600) aCore_Sleep(400);
Pseudocode / Description:
This snippet checks the Sensor attached to channel 0 to see if
it is greater then 400. If it is, then it turns off the motors on
a 2WD differential robot and then waits for 1 second.
while (aA2D_ReadInt(1) < 100) {
aMo_Go(0,0);
aCore_Sleep(10000);
}
Pseudocode / Description:
The first snippet loops forever, continuously executing what
is inside the curly braces.
The second snippet loops only when the sensor reading is below 100.