Page 3 of 25

Re: wishlist for NXC!

Posted: 17 Oct 2010, 12:53
by mattallen37
I don't think John has the hardware to build/test drivers for it. If you can get the I2C register information, couldn't you write your own drivers?

Re: wishlist for NXC!

Posted: 17 Oct 2010, 13:00
by HaWe
it's a wishlist.
Please be so kind and give John the chance to reply before you do (regardless of if it's right what you think or if you think you are right) :mrgreen:

Re: wishlist to John Hansen for NXC!

Posted: 17 Oct 2010, 15:22
by mattallen37
I was actually speaking more to you, than for John. I didn't mean to say anything for John (though I do know that on nxtasy, he said he didn't have the hardware). I meant it more for you, that you can do it yourself. You probably just need a register list (and obviously the ability to use the I2C commands in NXC).

Re: wishlist to John Hansen for NXC!

Posted: 17 Oct 2010, 15:56
by HaWe
I understood quite right what and whom you meant.
But 1st, I'm awfully bad in low level programming. So if I posted this wish to the "wishlist to John Hansen for NXC!" you might assume that I might have been thinking about what I'm about to do.
And 2nd, how will you know that John didn't already purchase a Tetrix kit which he once wanted to order?

The point is: It's my wish to John, and only John can say what he's about to do.
Please give him just the time to think about the wish before you reply in his place immediately like a shot from the hip ;)

Re: wishlist to John Hansen for NXC!

Posted: 17 Oct 2010, 16:52
by afanofosc
I am working on API functions for the HiTechnic motor and servo controllers (even though I do not have the hardware yet to test them with).

John Hansen

Re: wishlist to John Hansen for NXC!

Posted: 17 Oct 2010, 16:55
by HaWe
Thank you!
I will probably receive my Tetrix in the next few days.
Frank Engeln (he already contacted you as he mailed) and me will gladly test it and give you feedback!

Re: wishlist to John Hansen for NXC!

Posted: 30 Oct 2010, 11:11
by HaWe
hi,
what about an absolute MotorEncoderTarget aditionally to the existing, relative ones? (like RobotC)

Re: wishlist to John Hansen for NXC!

Posted: 31 Oct 2010, 10:34
by HaWe
afanofosc wrote:I am working on API functions for the HiTechnic motor and servo controllers (even though I do not have the hardware yet to test them with).
John Hansen
John,
could you please publish sort of header file which could be #included as far as they have not been finally implemented to the API ?
thx in advance

Re: wishlist for NXC

Posted: 05 Dec 2010, 09:51
by HaWe
can we have WriteI2CRegister() work with variable register values (calculated at runtime)?
mightor wrote:I did some experimentation and it seems that if the register is not known at compile time then it just won't work.

Code: Select all

result=WriteI2CRegister(NXTport, devAddr, powerReg, percentage);  
breaks

Code: Select all

result=WriteI2CRegister(NXTport, devAddr, 0x45, percentage); 
compiles fine.
- Xander
for example for code like this:

Code: Select all

void TXMotorOn(byte NXTport, byte TXmotor, char percentage)
{
  byte devAddr, modeReg, powerReg;
  char result;

  devAddr = (TXmotor+2)&14;
  modeReg = 0x44 + (TXmotor % 2)*3;
  powerReg= 0x45 + (TXmotor % 2);

  // NXTsensorPort, I2Caddress, 44H byte Motor_mode: 0=power control
  result=WriteI2CRegister(NXTport, devAddr, modeReg,  0);

  // NXTsensorPort, I2Caddress, 45H s/byte  Motor_power: e.g. 50 =50%
  result=WriteI2CRegister(NXTport, devAddr, powerReg, percentage);
}

Re: wishlist for NXC

Posted: 05 Dec 2010, 12:22
by HaWe
can we have more kinds of formatting parameters for FormatString or printf except %d or %f
like

Code: Select all

	%d %i	Decimal signed integer.
	%o	Octal integer.
	%x %X	Hex integer.
	%u	Unsigned integer.	
	%f	floating point number
	%c	Character.
	%s	String
especially formatting as "Hex Integer" would be fine to display e.g. 0x44 as "x44" or "44h" and not as "68",
and %s would be fine to pass string variables to the printf function.