wishlist for NXC

Discussion specific to NXT-G, NXC, NBC, RobotC, Lejos, and more.
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: wishlist for NXC!

Post 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?
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
HaWe
Posts: 2500
Joined: 04 Nov 2014, 19:00

Re: wishlist for NXC!

Post 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:
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: wishlist to John Hansen for NXC!

Post 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).
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
HaWe
Posts: 2500
Joined: 04 Nov 2014, 19:00

Re: wishlist to John Hansen for NXC!

Post 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 ;)
afanofosc
Site Admin
Posts: 1256
Joined: 26 Sep 2010, 19:36
Location: Nashville, TN
Contact:

Re: wishlist to John Hansen for NXC!

Post 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
Multi-platform LEGO MINDSTORMS programming
http://bricxcc.sourceforge.net/
HaWe
Posts: 2500
Joined: 04 Nov 2014, 19:00

Re: wishlist to John Hansen for NXC!

Post 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!
HaWe
Posts: 2500
Joined: 04 Nov 2014, 19:00

Re: wishlist to John Hansen for NXC!

Post by HaWe »

hi,
what about an absolute MotorEncoderTarget aditionally to the existing, relative ones? (like RobotC)
HaWe
Posts: 2500
Joined: 04 Nov 2014, 19:00

Re: wishlist to John Hansen for NXC!

Post 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
HaWe
Posts: 2500
Joined: 04 Nov 2014, 19:00

Re: wishlist for NXC

Post 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);
}
HaWe
Posts: 2500
Joined: 04 Nov 2014, 19:00

Re: wishlist for NXC

Post 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.
Post Reply

Who is online

Users browsing this forum: No registered users and 25 guests