| | newbie questions... Stelian Pop
|
| | Hi everybody, I recently acquired a RIS 1.5 box and started playing with nqc (great program btw)... Still, I have some questions... Let's take a simple example: I have 1 touch sensor and I want to do a SOUND_UP when the touch is pressed and a (...) (24 years ago, 6-Sep-00, to lugnet.robotics.rcx.nqc)
|
| | |
| | | | Re: newbie questions... Dave Baum
|
| | | | (...) Both versions should work ok. Personally I prefer something like the following code because its less code overall and the "modality" of the program is apparent from the listing. But its really a matter of personal style. #define TOUCH SENSOR_1 (...) (24 years ago, 9-Sep-00, to lugnet.robotics.rcx.nqc)
|
| | | | |
| | | | | | Re: newbie questions... Stelian Pop
|
| | | | (...) Ok, so the 'if ( ActiveEvents(10) & EVENT_MASK(0) )' is the correct syntax to check if event 0 was triggered ? (...) Or a function that returns the current task number ? Thanks for your advices and keep up the good work ! Stelian. (24 years ago, 11-Sep-00, to lugnet.robotics.rcx.nqc)
|
| | | | |
| | | | | | Re: newbie questions... Dave Baum
|
| | | | (...) yes (...) That's pretty tough to implement. Code in the tasks is easy...the task number is a constant. Same for subs that are only called from one task. Inline functions are also easy...provided they are called from one of the above. The (...) (24 years ago, 12-Sep-00, to lugnet.robotics.rcx.nqc)
|
| | | | |
| | | | | | Re: newbie questions... Stelian Pop
|
| | | | (...) Thanks. (...) I see... Anyway, there shouldn't be a great need to monitor the same event in different tasks, so it's not that important... Let's give LEGO the time to add this in the firmware then :) (...) Great! Stelian. (24 years ago, 12-Sep-00, to lugnet.robotics.rcx.nqc)
|
| | | | |