Show Posts
Pages: 1 ... 53 54 [55] 56 57 ... 115
811  Using Arduino / Programming Questions / Re: objective - C RCOIP.h library on: January 08, 2013, 06:45:04 pm
Perhaps you might find these to be useful references?
812  Using Arduino / Programming Questions / Re: Moving analog data over serial on: January 07, 2013, 05:22:51 pm
It isn't partuclarly crap. "parseInt()" sits there trying to read in values from the Serial port until it either times out (and returns 0), or another character arrives in and it sits there trying to read the next. That means that it doesn't need for Serial.available() to be any more than 1 when you first call it for it to work.

Granted the implementation could be improved, for example, if you send "12-34" it will detect it as -1234, and if it takes too long for the 2nd, 3rd, and so on characters to arrive after each other it will just give up and return.
Also that example doesn't account for the fact that you should wait until Serial.available()>0 in between each of the calls to parseInt().
813  Using Arduino / Programming Questions / Re: problems with softserial and ATtiny85 on: January 07, 2013, 05:02:24 pm
Can I suggest you try the tiny core I wrote?

It has software serial routines which are designed to mimic the way the hardware serial library does, which means you dont need the softwareserial library, simply use the normal Serial.print(), Serial.available(), commands etc. as you would for a regular arduino. There are no set baud rates, and I have had success with rates as high as 115200.

There are two small caveats/differences between it and Hardware serial.
The first is that TX must be digital 0 and RX must be digital 1 (which is just swapping RX and TX in your case). This i because my library uses the built in analog comparator to supply an interrupt vector. It features the same ring buffer as Hardware Serial does meaning that polling is not required.
The second is that is cannot transmit and recieve Serial data at the same time (its Half Duplex), but you don't appear to need to.
814  Using Arduino / Project Guidance / Re: Speedy line follower ( Due/ Raspi/Launchpad, which to use?) on: January 07, 2013, 03:30:08 pm
I suppose I will have to clarify my position...

When you have an Uno, a Mega, and a Due to play with, those would be a far better option when you have to do things such as control the speed of multiple motors accurately.
815  Using Arduino / Microcontrollers / Re: Does the latest IDE support 644P and 1284P? on: January 07, 2013, 03:14:13 pm
I seem to recall reading somewhere that xmegas were though about but were ditched due to reliability and supply issues.

Also, there is an Arduino IDE spinoff for XMegas:
But I believe they forked the whole IDE, so it isn't as simple as just a new core.
816  Using Arduino / General Electronics / Re: transistor gate does not respond to arduino on: January 07, 2013, 10:23:11 am
They'll do. Just connect the emitter to ground, the collector to the gate of the MOSFET (and a 10k resistor to +12v), and the base via a 1k resistor to the arduino.
817  Using Arduino / General Electronics / Re: transistor gate does not respond to arduino on: January 07, 2013, 09:38:25 am
You are going to have to post a schematic of how the transistor is wired.
818  Using Arduino / Programming Questions / Re: Why does this work in a .h but not in a .ino? on: January 07, 2013, 05:19:00 am
In recent versions. You need 1.0.3 onwards for this to work (or maybe 1.0.2, I can't remember right now).
So it doesn't. I've been using 1.5 as I have a Due, I guess I assumed the two would be similar.
819  Using Arduino / General Electronics / Re: SFE microSD Breakout woes ... on: January 07, 2013, 05:16:10 am
The begin() function calls card.init() with SPI_HALF_SPEED:

boolean SDClass::begin(uint8_t csPin) {

    Performs the initialisation required by the sdfatlib library.

    Return true if initialization succeeds, false otherwise.

  return card.init(SPI_HALF_SPEED, csPin) &&
         volume.init(card) &&

Which means it is running too fast. In Windows, if you open the following file (it is slightly different on Mac):
<arduino directory>/libraries/SD/SD.cpp

You will find the begin() function declaration, just change the SPI_HALF_SPEED to 2.

As for the TXB0104, there are breakout boards available ready soldered: (This is actually the 8 channel version, TXB0108),-level-shifter,-3v/5v,-14-pin-wide-dip.html (4 channel TXB0104)
820  Using Arduino / Project Guidance / Re: Speedy line follower ( Due/ Raspi/Launchpad, which to use?) on: January 06, 2013, 07:18:17 pm
You wouldn't use the Raspberry Pi for something like that. It runs linux, which is not a real time operating system.
821  Using Arduino / General Electronics / Re: SFE microSD Breakout woes ... on: January 06, 2013, 07:11:07 pm
A sudden thought occured

Try changing this line:
 if (!card.init(SPI_HALF_SPEED, chipSelect)) {
 if (!card.init(6, chipSelect)) {

That will slow down the SPI to the slowest possible speed of FCPU/128

If that works, try decreasing the number to 5, then 4, then 3 and so on. Each time it will double the speed.

With simple level converters like these, I was never able to get it to run faster than FCPU/8 (aka SPI_QUARTER_SPEED) reliably. Once i switched to a proper level shifter like the TXB0104, I could get up to the full speed of FCPU/2 (aka SPI_FULL_SPEED).

Just as a side note, the card.init() call initialises the card at FCPU/128, and then at the end of the routine sets it to full speed. This means that the volume.init() call will be running on a an SPI at a much higher freqency than card.init() which could be the reason why it fails at that point.
822  Using Arduino / Microcontrollers / Re: Arduino with Atmega32A core on: January 06, 2013, 04:40:14 pm

$7 doesn't seem that bad for an Atmega1284P. Its £3.80 here in the UK.
823  Using Arduino / Displays / Re: ARDUINO 4DISPLAY SHIELD 160 on: January 06, 2013, 04:29:35 pm
The message to take away from the comment it, first thing to do is Google it...

Second result any good?

There is a minor issue with that library in that it doesn't support Arduino 1.0+, but you can make it supporting by opening the file "displayshield4d.cpp" and replacing the line:
#include "WProgram.h"
with the line:
#include "Arduino.h"
824  Using Arduino / Displays / Re: lcd.print and lcd.write at one line on: January 06, 2013, 04:24:00 pm
If you don't want to convert to Octal, you can add letters in hex:
char string[] = "\x30\x31\x32";
is equivalent to:
char string[] = "123";
is equivalent to (octal):
char string[] = "\060\061\062";
825  Using Arduino / General Electronics / Re: SFE microSD Breakout woes ... on: January 06, 2013, 04:18:47 pm
If I were you, I would swap which level shifter you are using for DI and CS.

DI <- TXI (ch2) <- TXO (ch2) <- MOSI
CD <- RXO (ch2) <- RXI (ch2) <- pin4

Goodness knows why Sparkfun gave the signals the names they did  smiley-roll. Basically the mosfet shifter is bidirectional, but it will perform better than the resistor divider and is better suited to the data line, or even better still the clock line, for example:

DO -> TXI (CH1) on LV side -> TXO (CH1) on HV side -> MISO on Uno
SCK <- TXI (ch2) on LV side <- TXO (ch2) on HV side <- SCK on Uno
VCC <- 3.3V on Uno
DI <- RXO (CH1) on LV side <- RXI (CH1) on HV side <- MOSI on Uno
CS <- RXO (ch2) on LV side <- RXI (ch2) on HV side <- pin 4 on Uno
Pages: 1 ... 53 54 [55] 56 57 ... 115