Show Posts
Pages: 1 ... 139 140 [141] 142 143 ... 353
2101  Using Arduino / Project Guidance / Re: MAX485, serial and programming port on: May 08, 2013, 03:45:11 am
Quote
I'm using an Arduino Pro Mini 328 from SparkFun.  Any guidance on determining which pins and which timer  I can use for AltSoftSerial?

The Pro Mini should behave like a standard UNO in this context. That means the pins are D8 and D9 and you loose PWM on pin D10.
2102  International / Deutsch / Re: Musik mit Arduino Mega abspielen on: May 08, 2013, 03:28:38 am
Quote
das breakout Board dass du mir empfohlen hast ist ja leider ausverkauft.

Nicht an Lager heisst doch nicht ausverkauft. Bei SparkFun gibt es das Board noch (https://www.sparkfun.com/products/11125), also kannst Du es bei Boxtec (oder einem anderen Anbieter, der SparkFun-Produkte führt) bestellen.
2103  Using Arduino / Programming Questions / Re: Serial.flush on arduino mini?? on: May 08, 2013, 03:24:53 am
Code:
while (Serial.available()) Serial.read();

... does empty your incoming buffer.

But your description sounds like you're having another problem. Is it possible that you have a loopback at the serial interface? Does it work if you don't print out the same character as you're receiving?
2104  Using Arduino / Programming Questions / Re: spi 9bit eeprom address can only see addr 0x00? on: May 08, 2013, 03:00:27 am
Quote
this is what interil told me to look at, i cannot however translate this to arduino

Looks like the chip has to be initialized a bit further before being ready:

Code:
//4k e2prom and cpu supervisor

#include <SPI.h>
#define WRITE 2
#define READ  3
#define WREN  6
#define RDSR  5
#define WRSR  1

unsigned int address = 0x01;
byte outval = 250;
byte invalue;

void setup(){
  Serial.begin(9600);
  Serial.println("RESET");

  // set up to match device datasheet
  SPI.begin(); // sets up pin modes etc.
  SPI.setBitOrder(MSBFIRST);
  SPI.setDataMode(SPI_MODE0);
  SPI.setClockDivider(SPI_CLOCK_DIV2); // max clock is 20MHz, so can set high speed

  // Enable writing
  digitalWrite(SS, LOW);
  SPI.transfer(WREN);
  digitalWrite(SS, HIGH);

  // Initialize status register
  digitalWrite(SS, LOW);
  SPI.transfer(WRSR);
  SPI.transfer(0x00);
  digitalWrite(SS, HIGH);

  // Latch enable write again (don't know why this is necessary)
  digitalWrite(SS, LOW);
  SPI.transfer(WREN);
  digitalWrite(SS, HIGH);

  // write a value to address 0x01
  digitalWrite(SS,LOW);
  SPI.transfer(WRITE | (address & 0x0100) ? 8 : 0);
  SPI.transfer(address & 0xFF);
  SPI.transfer(outval);
  digitalWrite(SS, HIGH);

  // read a value from address 0x01
  digitalWrite(SS,LOW);
  SPI.transfer(READ | (address & 0x0100) ? 8 : 0);
  SPI.transfer(address & 0xFF);
  invalue = SPI.transfer(0x00);
  digitalWrite(SS,HIGH);
  Serial.print("Read Data = ");
  Serial.println(invalue,DEC);
}

void loop() {
}

What's the output of this sketch?
2105  Using Arduino / Project Guidance / Re: SCR gate controller circuit on: May 07, 2013, 01:13:05 pm
How did you connect the sine wave to the Arduino? Is the sine wave going from 0V to 5V or from -5V to 5V?

delayMicroseconds() can be called with values up to 13107, if you call it with higher value you'll have a bit overrun. So calling it with 14108 is about the same as calling it with 1000.
2106  Using Arduino / Project Guidance / Re: MAX485, serial and programming port on: May 07, 2013, 12:58:40 pm
Quote
Great, thanks for the info.  I'll use softserial for the RS485 comms then.  My needs are very simple but I need to be able to program with the MAX485 connected.

SoftwareSerial is not a drop-in replacement for a hardware serial interface. Reliable communication is possible up to 9600 baud, in some cases up to 38400 baud. During the transfer of a byte over the SoftwareSerial interface (independent of the direction) the processor is completely absorbed and cannot be used for anything other. If you can live with this, use the SoftwareSerial. Otherwise you might take a look at the AltSoftSerial library (http://www.pjrc.com/teensy/td_libs_AltSoftSerial.html) or use another Arduino model (Leonardo or Mega) which has more hardware serial interfaces.
2107  Using Arduino / Programming Questions / Re: spi 9bit eeprom address can only see addr 0x00? on: May 07, 2013, 12:49:04 pm
Post the code your using for this.
2108  International / Deutsch / Re: Musik mit Arduino Mega abspielen on: May 07, 2013, 12:45:53 pm
Quote
Ich weiß aber nicht wie viele Pins und welcher Art Pins dieses Shield benötigt. Kannst du mir vielleicht sagen wie man das herausfindet. Auf der Wiki-Seite hab ich nicht gefunden und selbst gemacht hab ich so etwas leider noch nie.

Das Shield benötigt zusätzlich zu den SPI-Pins (die aber ein Bus sind und deshalb von mehreren Shields/Erweiterungen benützt werden können) noch 5 weiter digitale IO-Pins (standardmässig auf Pin 10 und A0-A3 verdrahtet), den Rest könntest Du weglassen. Mit dem Mega hast Du aber mehr als genügend Pins, wofür hast Du die denn alle gebraucht?
Ideal ist das Shield wahrscheinlich schon deshalb nicht, weil die Daten von der SD-Karte über den Arduino geleitet werden und vom Musik-Chip nicht direkt gelesen werden. Für Deine Anwendung wäre ein Breakout wie dieses:

http://shop.boxtec.ch/audio-sound-breakout-wtv020sd-p-40949.html

besser geeignet. Du brauchst nur 2 Pins vom Arduino für die Steuerung (notfalls genügt sogar einer) und die Musik spielt direkt von der SD-Karte ab.
2109  Using Arduino / Sensors / Re: PIR Sensor Milk Colour Plexiglass on: May 07, 2013, 12:26:35 pm
Quote
Hey, I was wondering if PIR Sensor like https://www.sparkfun.com/products/8630 will be able to detect movement via milk plexiglass?

Does your milk plexiglass let transfer infrared beams? If yes, the sensor will work. Ask the plexiglas manufacturer about the transparency for infrared wavelengths.
2110  Using Arduino / Project Guidance / Re: MAX485, serial and programming port on: May 07, 2013, 12:11:36 pm
Quote
If I connect a MAX485 to it, can I still use for programming?

You can use a Leonardo for this, there the hardware serial port is free for you to use and you still have the debugging serial connection (or sketch upload) to the PC over the USB bus.
2111  Using Arduino / Project Guidance / Re: SCR gate controller circuit on: May 07, 2013, 12:08:14 pm
Did you fix the two problems I mentioned?

BTW: you print d in ms to the display but use delayMicroseconds() in the sketch.
2112  Using Arduino / Project Guidance / Re: Sound Level Detector on: May 07, 2013, 12:03:17 pm
Quote
Not sure I would agree with that. What is the right sort of microphone, it would have to be one with a built in amplifier.

Yep, something like this:

http://shop.boxtec.ch/electronic-brick-sound-sensor-microphone-brick-p-40472.html
2113  Using Arduino / Networking, Protocols, and Devices / Re: Arduino UNO not working with Arduino WiFi shield on: May 07, 2013, 11:59:23 am
Sounds to me a bit like your board is in constant reset state. Is it possible that the reset button (of the shield) got uptight somehow?
2114  Using Arduino / Networking, Protocols, and Devices / Re: Testing SoftwareSerial port loopback *Help me pls* on: May 07, 2013, 11:57:29 am
SoftwareSerial doesn't support a loopback because both the sending and receiving functions blocks the processor completely. So while you're sending a byte you cannot receive anything and while you're receiving a byte not one bit will be sent out.
2115  Using Arduino / Networking, Protocols, and Devices / Re: Problems whit Ethernet Shield and SD on: May 07, 2013, 11:54:29 am
Did the IP address in that code really match your network setup?

Quote
it works, but sometines take a very long time to load or the page dont load, when my wi-fi signal is low this happen more

How does the Wifi come into that equation? Didn't you connect the accessing PC to the network by cable? We usually don't do WiFi network debugging in this forum.

The sketch you linked to uses the String class exactly the way it should never be used. You should try to eliminate the String class completely because it's implemented in a way not suitable for microcontrollers without a MMU. Additionally it suffers from a memory leak bug still contained in the current versions of the IDE. This results in unexpected behavior and crashes after a few runs of your loop routine.
Pages: 1 ... 139 140 [141] 142 143 ... 353