Show Posts
Pages: 1 ... 3 4 [5] 6 7 ... 10
61  Using Arduino / Motors, Mechanics, and Power / Re: Best motor for sliding part of robot? on: March 18, 2013, 09:40:16 am
A servo Might do the job for short distance otherwise consider a stepper motor.
62  Using Arduino / Sensors / Re: Sensing water? on: March 18, 2013, 09:28:56 am
You could use just two wires as a conductivity tool. One would be VCC+ and the other one would be connected to a pin that would sense the voltage fro the VCC+ with the analogRead() function. When the two wires contact the water the flow of electricity become higher and that way you could detect if there is any water.
63  Using Arduino / Interfacing w/ Software on the Computer / Re: how to interpret the serial data on: March 18, 2013, 09:24:34 am
This example may help you grasp the basics.

Code for Arduino:

Code:
void setup() {
  Serial.begin(9600);
}

void loop() {
  Serial.println(analogRead(A0));
  delay(2);
}

Code for Processing:
Code:
import processing.serial.*;
 
 Serial myPort;        // The serial port
 int xPos = 1;         // horizontal position of the graph
 
 void setup () {
 // set the window size:
 size(400, 300);       
 
 // List all the available serial ports
 println(Serial.list());
 // I know that the first port in the serial list on my mac
 // is always my  Arduino, so I open Serial.list()[0].
 // Open whatever port is the one you're using.
 myPort = new Serial(this, Serial.list()[0], 9600);
 // don't generate a serialEvent() unless you get a newline character:
 myPort.bufferUntil('\n');
 // set inital background:
 background(0);
 }
 void draw () {
 // everything happens in the serialEvent()
 }
 
 void serialEvent (Serial myPort) {
 // get the ASCII string:
 String inString = myPort.readStringUntil('\n');
 
 if (inString != null) {
 // trim off any whitespace:
 inString = trim(inString);
 // convert to an int and map to the screen height:
 float inByte = float(inString);
 inByte = map(inByte, 0, 1023, 0, height);
 
 // draw the line:
 stroke(127,34,255);
 line(xPos, height, xPos, height - inByte);
 
 // at the edge of the screen, go back to the beginning:
 if (xPos >= width) {
 xPos = 0;
 background(0);
 }
 else {
 // increment the horizontal position:
 xPos++;
 }
 }
 }
64  Using Arduino / Interfacing w/ Software on the Computer / Re: Processing to Arduino, mistakes while transfering data on: March 18, 2013, 09:21:20 am
You should check the Serial Monitor baud rate too. It is supposed to be 9600bps.
65  Using Arduino / LEDs and Multiplexing / Re: TLC5940 and ATtiny84 - working! on: March 18, 2013, 08:44:07 am
Wow! Nice job with the programming!
66  Using Arduino / LEDs and Multiplexing / Re: controlling several LED's with one button on: March 18, 2013, 08:42:06 am
First of all, You could control numbers more easily using a 7 segment display. So instead of configuring 10 LEDS, just use one of these displays and save some time.
https://www.sparkfun.com/products/8546

Consider some debouncing code for the buttons too. Read about it more in the links:
http://arduino.cc/en/Tutorial/Debounce

This is a very neat debounce tutorial:
http://www.ladyada.net/learn/arduino/lesson5.html

67  Using Arduino / Project Guidance / Re: Current use by GSM Shield on: March 18, 2013, 08:38:10 am
I thought of hearing something like 0.60 miliamps during a transmission and the supply voltage of the shield Is 5Volts. If you do the math you would get something like 0.30 watts.
68  Using Arduino / General Electronics / Re: Transistors for RC motor wiring confusion on: March 18, 2013, 08:31:35 am
Does this look correct ?


Consider adding a diode from positive to negative right in the same connections on you motor. This will make the voltage flow in one direction and would prevent the electronics from getting damaged when the motor if off but still spining.
69  Using Arduino / General Electronics / Re: Using an LED driver to fire keys on a toy keyboard on: March 18, 2013, 08:29:01 am
An 8-Bit Shift Register 74HC595 might solve the problem.

https://www.sparkfun.com/products/733
70  Using Arduino / Programming Questions / Re: Simple LED pushbutton sketch won't behave as it should. on: March 18, 2013, 08:23:21 am
Despite the errors in the code I think debounce would be an issue as well. When you push a button, it takes around 150ms to get it down. But in those 150ms the button sometimes doesn't just change the state at once but instead it could have on/off flicks of as fast as 5ms in one single push. This happens because of the hardware, but then the Arduino reads those debounces and thinks that that they are state changes. Consider adding some debounce code to you sketch.

Read more on the topic for a better understanding:
http://arduino.cc/en/Tutorial/Debounce
71  Using Arduino / Programming Questions / Re: Map button matrix to integers on: March 18, 2013, 08:14:59 am
How can you map readings of buttons to ints if they are boolean readings? They only have on/off states. However if you are talking about mapping them in the sense of their position, then consider using a multiple dimension array.

http://arduino.cc/forum/index.php?topic=44228.0

Or here is an example:

Code:
array [x][y] {
boolean read = digitalRead(array [x][y]);
}

72  General Category / General Discussion / Re: Is Arduino Output Dangerous? on: March 17, 2013, 07:43:51 pm
Depends what kind of Output you mean. If you mean the Output force of an Arduino board orbiting Earth striking a space station, than yeah that would be dangerous for the crew living on the spaceship.

If you calculate: The mass of an Arduino board is about 25grams and various objects orbit Earth at a speed of 2000 m/s. Now we could find the momentum with this formula. p=m*v.

p=2000*0.025=50 kg/s

I think that is enough to treat a life. 

If you are talking about the electric current from the Arduino being dangerous for you, then that is too boring to answer. But considering that you are a Newbie and this is your first post, I'm not going to say anything else.
73  Using Arduino / Microcontrollers / Re: Why an Attiny85 running at 8MHz is under clocked when programming with Arduino. on: March 17, 2013, 05:50:45 pm
Hi

Just have the ATTiny connected as you do for programming it, select the target as Tools>Board>Attiny85 @ 8MHz (internal oscillator; BOD disabled) and then use the burn bootloader menu option.  After a few seconds you'll get the same PAGEL warnings (4 times IIRC) to confirm that it all worked.

That's truly all there is to it smiley
Geoff

Thanks for the help Geoff! Very much appreciated smiley
74  Using Arduino / Microcontrollers / Re: Why an Attiny85 running at 8MHz is under clocked when programming with Arduino. on: March 17, 2013, 05:08:47 pm
Hi,

Sounds like you missed the step of burning the bootloader to set the 8MHz fuses (or you did, but it didn't work). You can still upload the sketch to the 8MHz selection but it will be run 8x slower.  So your 2 second flash comes out around 16sec.

Geoff

I did in fact miss the step with the bootloader. I tried it before but when I followed a tutorial that I found on Internet it didn't work. Can you give a link that describes how to do it?

Do I just have to connect the RESET, SCK, MOSI and MISO from the Attiny85 to the Arduino, select the Attiny85 in the board options and click Tools > Burn Bootloader ?
 Is this right?
75  Using Arduino / Microcontrollers / Why an Attiny85 running at 8MHz is under clocked when programming with Arduino. on: March 17, 2013, 04:58:13 pm
Hi guys, I'm now working on a project were two devices have to communicate with each other. The devices are an Attiny85 and an Arduino UNO. It's crucial to me that they work at a same pace. When I was doing previous projects that consisted of an Attiny85 I ran it at 1Mhz since the timing was the closest to the Arduino UNO. I didn't select any other frequencies because they were way off timed. Plus the projects were simple, consisting of just few leds or servo's.

However, now I'm using a library that requires devices to run at least 8Mhz and when I upload a sketch to the Attiny85 using Arduino UNO as an ISCP and while clicking Tools > Board > Attiny85 @ 8MHz (internal oscillator; BOD disabled) the sketch starts to run incredibly slower.
Note: the board options are from an aditional library

For Example:
If I take a sketch that everybody is familiar with, which is the blink sketch that blinks the famous LED on pin 13 on Arduino boards once every two seconds and upload it to the Attiny85 selecting the 8Mhz option (obviously changing the led number 13 to a number from 0 to 4 which corresponds to the pins on the Attiny85). I get a LED blinker that dosent blink every two seconds but instead blinks every ˜10-15 seconds.

So obviously there is a problem with the configuration with the internal clock but I'm sure that I misconfigured something too.

I hope my point was clear. Help would be appreciated,
miXania.
Pages: 1 ... 3 4 [5] 6 7 ... 10