Code: Select all
LSWRITE (here I send 0x02 0x41 0x01 for the single shot mode)
do{
LSWRITE (here I send 0x02 0x42 for the read measurement byte 0)
bytesRead=LSGETSTATUS
}while(bytesRead<1)
LSREAD
Thanks,
Kami
Code: Select all
LSWRITE (here I send 0x02 0x41 0x01 for the single shot mode)
do{
LSWRITE (here I send 0x02 0x42 for the read measurement byte 0)
bytesRead=LSGETSTATUS
}while(bytesRead<1)
LSREAD
Yes it does. It's BlueTooth is very fast as well. I have a program that allowes you te send data over BT to excel. The NXT can transfer a message every 4-6 msec. (search for NXT2excel on my blog to get it). The downside is that robotc only supports a single slave, unlike the standard firmware that allowes for 3 slaves simultaniously.ricardocrl wrote:Does RobotC have full-duplex?
Does it mean that a slave can spontaneously sent messages to a master, even being a laptop?
Where can I find more specific information about the differences between the firmwares?
Many thanks for the info.
Ricardo
This is probably what you are talking about.aswin0 wrote:...A few years ago someone made a table comparing all different languages/firmwares. I do not have the link but i'm sure you can find it. The table needs an update however. (this could well be a joined effort on this forum)
Thanks! That helped a lot.aswin0 wrote:Hi,
The first lswrite Is to make a setting, there is no reply from this command.
After that you have to query for a reply. As the NXT is a slave it cannot send a message on its own, it has to be queried for a reply. If you want a second reading you will have to query for it again. This is called half duplex. Only if you have full duplex communication the slave is able to send a message on its own initiative. The NXT firmware does only support half duplex communication. The firmware that comes with robotc supports full duplex communication.
Incidentally, a few days ago I sent some benchmark data for LeJOS to Steve Hassenplug, and he does intend to update the page.mattallen37 wrote:This is probably what you are talking about.aswin0 wrote:...A few years ago someone made a table comparing all different languages/firmwares. I do not have the link but i'm sure you can find it. The table needs an update however. (this could well be a joined effort on this forum)
I agree, it could use an update.
This doesn't make any sense to me.aswin0 wrote: As the NXT is a slave it cannot send a message on its own, it has to be queried for a reply. If you want a second reading you will have to query for it again. This is called half duplex. Only if you have full duplex communication the slave is able to send a message on its own initiative. The NXT firmware does only support half duplex communication. The firmware that comes with robotc supports full duplex communication.
Also, from a PDF comparing 3 popular serial buses, JTAG, SPI, and I2c:I2C, due to its two-wire nature (one clock, one data) can only communicate half-duplex.
I2C is master/slave. This means nothing comes from the slave unless the master requests it. The NXT is the master and the I2C devices you attach to the NXT are the slaves. The RobotC firmware does not somehow magically enable something that the 2-wire I2C serial bus hardware simply cannot support.since there is only one data line full-duplex cannot be supported.
Code: Select all
Read Size Time taken Bytes/s Transaction time Transactions/s
1 7000 143 7.00 143
2 8000 250 8.00 125
3 9000 333 9.00 111
4 10000 400 10.00 100
5 11000 455 11.00 91
6 12000 500 12.00 83
7 13000 538 13.00 77
8 13000 615 13.00 77
9 14000 643 14.00 71
10 15000 667 15.00 67
11 16000 688 16.00 63
12 17000 706 17.00 59
13 18000 722 18.00 56
14 18792 745 18.79 53
15 19000 789 19.00 53
16 20000 800 20.00 50
You'd have to post your code before anyone could say definitively what, if anything, you are doing wrong. Are you using your special direct command replacement function that we discussed here: https://sourceforge.net/apps/phpbb/mind ... ?f=3&t=487? If so then it may be a problem with the way you are draining the response. Are you getting back non-zero status values?lizard381 wrote:I seem to be having a problem where I can set the sensor type and sensor mode but I can't reset it within the same program [for instance, I first set the color sensor to colorfull/raw, then i want to set it to colorred/pctfullscale]. Similarly, I can read from each sensor once, but after that when I try to query the sensor it writes 0 bytes to the response buffer. If I restart the program I'm fine but this doesn't seem right. Is there some sort of buffer flushing I should be doing that I'm not doing?
Users browsing this forum: Semrush [Bot] and 4 guests