NXT reading speed

Discussion specific to the intelligent brick, sensors, motors, and more.
floppi
Posts: 48
Joined: 25 Jul 2012, 22:55

Re: NXT reading speed

Post by floppi »

mattallen37 wrote:You mean 10 bit? A 10 bit number is a number between 0 and 1023. The NXT and Arduino both have 10 bit ADCs (although the analog inputs on the NXT have permanent 10k pullup resistors).

How are you controlling the IR LED? I wrote an Arduino library for that as well, in case you're interested.
yes i ment 10bit, i thought nxt was reading a value between 0 and 255 ( 8bit ) and arduino 10 bit ( value between 0 to 1024 ) ?
As i write i found my error : I want to use only 1 sensor port of the nxt, so use pcf8594 which is 8bits, nxt have 10bits adc with sensor port configured for this directly ?

concerning the ir Led I found a ready to use example : i call a function like this : ComboMode(BLUE, RED, CH1);

the function used a digital output with delaymicrosecond to drive the ir led.
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: NXT reading speed

Post by mattallen37 »

The NXT's analog input pins are connected to the 10-bit ADCs of the AtMega48 co-processor. NXC (and I assume all other programming languages) give the user access to the truly raw values. The analog inputs are also pulled up to sensor supply, through a 10k resistor.

The Arduino analog inputs are connected to the 10-bit ADCs of the (in the case of the Uno) AtMega328.

I'm fairly sure that the PCF8591's ADCs are 8-bit, but I've never personally used that IC.

While that approach should work to control an IR LED, it requires 100% of the processor power available to the user (it can't run in the background). My PFIR library is timer interrupt based, so you use a couple commands to set it up, and then it runs totally in the background. The only time you need to call any PFIR functions after setup, is to set new values (i.e. different motor speeds).
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
floppi
Posts: 48
Joined: 25 Jul 2012, 22:55

Re: NXT reading speed

Post by floppi »

mattallen37 wrote:The NXT's analog input pins are connected to the 10-bit ADCs of the AtMega48 co-processor. NXC (and I assume all other programming languages) give the user access to the truly raw values. The analog inputs are also pulled up to sensor supply, through a 10k resistor.

The Arduino analog inputs are connected to the 10-bit ADCs of the (in the case of the Uno) AtMega328.

I'm fairly sure that the PCF8591's ADCs are 8-bit, but I've never personally used that IC.

While that approach should work to control an IR LED, it requires 100% of the processor power available to the user (it can't run in the background). My PFIR library is timer interrupt based, so you use a couple commands to set it up, and then it runs totally in the background. The only time you need to call any PFIR functions after setup, is to set new values (i.e. different motor speeds).
I will take a look on your blog !

My project will be a melting pot of your library at the end :lol:
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: NXT reading speed

Post by mattallen37 »

Second library on this page.

This post is about an Arduino program that combines the NXTI2C library with the PFIR library, so that the NXT can control PF through the Arduino.
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests