|
871
|
Using Arduino / Project Guidance / Re: Driving lots of 7-segment displays. (Or possibly 14-segment)
|
on: December 03, 2011, 12:48:04 am
|
|
Try checking out the MAX7221 chip. It's pretty expensive ($10) but you don't need to wire up resistors for the LEDs (save one for setting current) and you can just send it a string like "09221" over SPI (three pins) and it'll display them (ie a 7segment decoder). It can handle up to 8 digits (and you can string them up without using any extra arduino pins). It'll also do a LED Matrix if you like those.
The only other reasonable option from a string of breadboards is to have a custom PCB. And if you go with the breadboard route, the wiring will get pretty intense. Then again, custom PCBs are scary and somewhat expensive.
Also, you really don't need to worry about update speed; I doubt anything you'll have will be slower than the PC Serial connection, and you can only really perceive updates more than about 50ms apart (I believe that's 80000 clock cycles).
|
|
|
|
|
874
|
Using Arduino / Programming Questions / Re: .cpp and .h file locations
|
on: November 27, 2011, 08:19:15 pm
|
You'll want to have the pitches.h file in the same directory as your .pde file. The IDE creates a .cpp file out of your .pde file after it adds some things, the location of which can be found when holding shift while compiling (but not uploading). Also, you'll want to use this syntax: #include "pitches.h"
|
|
|
|
|
875
|
Using Arduino / Programming Questions / Re: Sampling Rate
|
on: November 25, 2011, 09:37:39 pm
|
But to get there you need to forget about the Arduino ADC sw layer and program directly the ADC registers (not difficult), and also condition your signal appropriately. Can you show how? There's a fine example in arduino-00xx/hardware/arduino/cores/arduino/wiring_analog.c and the datasheet for the 328 is certainly helpful.
|
|
|
|
|
877
|
Using Arduino / Programming Questions / Re: Serial Monitor - Can it continually print to top line?
|
on: November 25, 2011, 07:42:50 pm
|
I think this may work on windows (haven't tried it though). \r is carriage return and moves the cursor to the beginning of the line without going to the next one. You'll probably have a problem if your second message is shorter than the first one. void setup() { Serial.begin(9600); }
void loop() { int rand = random(0, 10); Serial.print("\r"); Serial.print(rand); delay(500); }
|
|
|
|
|
879
|
Using Arduino / Programming Questions / Re: Waiting for Key pressed (keypad)
|
on: November 22, 2011, 09:10:28 pm
|
How do you expect the key variable to change while you're looping? Put in the getKey function itself, or call it within the while loop, so that you get the current value. int key = KeypadX.getKey(); while (key == NO_KEY) key = KeypadX.getKey();
|
|
|
|
|
881
|
Using Arduino / Programming Questions / Re: compiler warnings
|
on: November 20, 2011, 11:48:24 pm
|
|
What I did is put a script in place of avr-g++ that calls the real avr-g++ with the same flags -- except it ignores the -w flag (disable warnings) and adds a -Wall flag (enable all warnings).
Of course, on Windows it's a lot harder.
Note that the standard libraries that come with Arduino have a ton of warnings in them, and few people will test their own libraries for warnings either.
|
|
|
|
|
882
|
Using Arduino / Programming Questions / Re: ISR Questions
|
on: November 20, 2011, 01:46:09 pm
|
You could try using the timer1 library. #include <TimerOne.h>
volatile unsigned int shotCount = 0; volatile unsigned int shotsPerSecond = 0;
void setup() { Timer1.initialize(1000000UL); // 1000000 microseconds (unsigned long) is 1 second Timer1.attachInterrupt(oneSecInterrupt); }
void loop() { if (ready) shotCount ++; }
void oneSecInterrupt() { shotsPerSecond = shotCount; shotCount = 0; }
|
|
|
|
|
885
|
Using Arduino / Programming Questions / Re: PLEASE HELP!
|
on: November 17, 2011, 01:32:53 am
|
Yeap the way you suggest is workable too.Anyway is possible as long as it's wireless and involves xBees,Arduino and the USB joystick.Do you have a sample code or website?
That was a question. For all we know, all you have is two xbees, an arduino, and a blender. What hardware do you have, and what was your idea for how to logically connect it together?
|
|
|
|
|