| | RE: pbLua PCF8574 SOLVED ?
|
|
(...) This is the excepted behavior. When you want to read from I2C device, the NXT firmware first sends a write message to load the internal index "pointer" for the I2C device and then sends a read message that will read the requested number of (...) (18 years ago, 21-May-07, to lugnet.robotics.nxt, lugnet.robotics.nxt.nxthacking)
|
|
| | Re: pbLua PCF8574 SOLVED ?
|
|
(...) Hi, or was it a quirk at my brain to address the i2c-read-address and hope to receive usefull data ? Currently it works for me when using allways the i2c-write address... Are the any demos or samples for NXC, using the PCF8574 ? 1. setting (...) (18 years ago, 21-May-07, to lugnet.robotics.nxt, lugnet.robotics.nxt.nxthacking)
|
|
| | Re: NXC - embedded functions failed
|
|
(...) This is definitely a problem in NXC. The problem is that the value of arg "a" (33) to the function Max is being replaced during the second call to Max since it passes 5 into arg "a". It looks like I need to figure out a decent way to implement (...) (18 years ago, 21-May-07, to lugnet.robotics.nxt)
|
|
| | Re: pbLua PCF8574 SOLVED
|
|
(...) Hi, we solved the problem... Lego-Firmware has own brain and handle read/write with own mechanisms ;-( The last read/write bit is handled automatically by lowlevel routines. Reading the same address like writing solves the problem. (...) (18 years ago, 21-May-07, to lugnet.robotics.nxt, lugnet.robotics.nxt.nxthacking)
|
|
| | NXC - embedded functions failed
|
|
#include "NXCDefs.h" int Max(int a,int b){ if (a>b) return a; else return b; } task main(){ int Prob=0; Prob = Max(33, Max(5,15)); NumOut(5,LCD_LINE2,false,Prob); //returns 15 WRONG ---...--- Prob = Max(5,15); Prob = Max(33,Prob); (...) (18 years ago, 20-May-07, to lugnet.robotics.nxt)
|
|
| | RE: NXT Programming with C Question
|
|
(...) Ralph and Brian have provided good input that parallels my experience. Here's a little more information. If you have access to the IAR tools you can compile the NXT firmware available in the NXT SDK from LEGO "out of the box". I believe there (...) (18 years ago, 20-May-07, to lugnet.robotics.nxt.nxthacking)
|
|
| | press button to return to pbLua-Interpreter
|
|
Hi Ralph, times ago, you have added the function to power off the NXT by pressing the orange button... But: what about implementing a function to break every running code and return back to interpreter ? It is very useful for debugging and (...) (18 years ago, 19-May-07, to lugnet.robotics.nxt)
|
|
| | Re: pbLua Hardware access
|
|
(...) All the nice IO-Ports of the ARM-CPU, which are connected to external ports :D But now I think, we did not need it any more. You are fast enough with your development and responses. Forget Peek and Poke from good old C64 times ;-) Thanks a lot (...) (18 years ago, 19-May-07, to lugnet.robotics.nxt, lugnet.robotics.nxt.nxthacking)
|
|
| | Re: pbLua PCF8574
|
|
(...) Hi Ralph, we are using this code: collectgarbage( "setpause", 110 ); function setupI2C(port) nxt.InputSetType(port,2) nxt.InputSetDir(port,1,1) nxt.InputSetState(port,1,1) nxt.I2CTimer(3) nxt.I2CInitPins(port) end function ReadPCF(port) (...) (18 years ago, 19-May-07, to lugnet.robotics.nxt, lugnet.robotics.nxt.nxthacking)
|
|
| | Re: NXT Programming with C Question
|
|
(...) Hi there, Thanks for venturing those reasons. I had been thinking that with the release of the NXT firmware that there may be options to compile code that worked directly with the firmware. Cheers (18 years ago, 19-May-07, to lugnet.robotics.nxt.nxthacking)
|