Introduction
Introduction Statistics Contact Development Disclaimer Help
tSimplify program and fix various bugs. Tested on RCX - lego_film_processor - s…
git clone git://src.adamsgaard.dk/lego_film_processor
Log
Files
Refs
README
LICENSE
---
commit 6350d48897168b5f89ac7b83e4e560bfcee32c9d
parent b8909fbc53bfccfb57ef79d9fda901a6a6d8b73d
Author: Anders Damsgaard <[email protected]>
Date: Fri, 12 Jul 2019 16:12:21 +0200
Simplify program and fix various bugs. Tested on RCX
Diffstat:
M lego_jobo.nqc | 43 ++++++++++++-----------------…
1 file changed, 17 insertions(+), 26 deletions(-)
---
diff --git a/lego_jobo.nqc b/lego_jobo.nqc
t@@ -1,48 +1,39 @@
#define T_TURN 500 /* turn each way for 5 s */
-#define OUTPUT OUT_A
#define DEVELOP_MINS 10 /* number of minutes to develop for */
#define DEVELOP_SECS 30 /* number of seconds to develop for */
-#define chime_speed 1
-
-void
-end_chime(int repeats)
-{
- int i;
- for (i=0; i<repeats; ++i) {
- PlayTone(147, 50*chime_speed); /* d */
- PlayTone(156, 50*chime_speed); /* d# */
- PlayTone(147, 50*chime_speed); /* d */
- PlayTone(294, 100*chime_speed); /* d+1 */
-
- PlayTone(147, 50*chime_speed); /* d */
- PlayTone(156, 50*chime_speed); /* d# */
- PlayTone(147, 50*chime_speed); /* d */
- PlayTone(175, 100*chime_speed); /* f */
- }
-}
-
task
main()
{
int t_current, t_end;
+ Off(OUT_A + OUT_B + OUT_C);
SetSleepTime(60);
- Off(OUTPUT);
- SetPower(OUTPUT, OUT_FULL); /* second arg an int between 0 and 7 */
+ SetPower(OUT_A, OUT_FULL); /* second arg an int between 0 and 7 */
+ On(OUT_A);
t_current = 0;
t_end = 60*DEVELOP_MINS + DEVELOP_SECS;
while (t_current < t_end) {
Wait(T_TURN);
- Toggle(OUTPUT);
+ Toggle(OUT_A);
- t_current += T_TURN;
+ t_current += T_TURN/100;
}
- Off(OUTPUT);
- end_chime(4);
+ Off(OUT_A + OUT_B + OUT_C);
+
+ PlayTone(147, 20); /* d */
+ PlayTone(156, 20); /* d# */
+ PlayTone(147, 20); /* d */
+ PlayTone(294, 40); /* d+1 */
+
+ PlayTone(147, 20); /* d */
+ PlayTone(156, 20); /* d# */
+ PlayTone(147, 20); /* d */
+ PlayTone(175, 40); /* f */
+
SetSleepTime(5);
}
You are viewing proxied material from mx1.adamsgaard.dk. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.