New blocks often are written to encapsulate a specific task, such as reading values from I2C sensors made by HiTechnic or Mindsensors.com. A number of custom blocks that you can install into the LEGO MINDSTORMS NXT software provide things like cos, sin, sqrt, etc... They don't call a new opcode or system call. They use existing opcodes and system calls to do multiple things that by wrapping in a convenient package can be easily reused. So the cos block mentioned earlier in this thread uses an algorithm to approximate the value of cosine for whatever input you wire into the block. If the firmware had a native cos opcode and the NXT-G compiler could dynamically generate the right output for new opcodes it would be possible to write an NXT-G block that just emitted something like "cos out, angle" which would write cos(angle) to the provided output variable.
John Hansen
Trig functions in NXT-G
Re: Trig functions in NXT-G
Multi-platform LEGO MINDSTORMS programming
http://bricxcc.sourceforge.net/
http://bricxcc.sourceforge.net/
Re: Trig functions in NXT-G
Writing NXT-G blocks is still a mystery for me. How is it done?
There should be a way to make a really ugly hack to give NXT-G more access to new firmware, one of the ugliest would be to use a specific I2C address to talk to the firmware, but I am sure (read: I hope) there is cleaner ways.
There should be a way to make a really ugly hack to give NXT-G more access to new firmware, one of the ugliest would be to use a specific I2C address to talk to the firmware, but I am sure (read: I hope) there is cleaner ways.
LEGO things http://ni.fr.eu.org/lego/ - NXT Improved Firmware (GCC) http://nxt-firmware.ni.fr.eu.org/ - Other robots http://apbteam.org
Who is online
Users browsing this forum: No registered users and 0 guests