Show Posts
Pages: 1 ... 53 54 [55] 56 57 ... 225
811  Using Arduino / Sensors / Re: Reduce PIR Sensor Sensitivity? on: December 28, 2013, 10:39:36 pm
PIR establishes a snapshot of the environment while it settles. Then it alarms if the environment changes from that snapshot. So, if the robot is stationary and takes its snapshot, then moves, the environment changes compared to what it saw a second ago, and it alarms.

PIR's not the right sensor for that application.
812  Using Arduino / Programming Questions / Re: Weird input errors? on: December 28, 2013, 10:23:10 pm
Try with char instead of int, and put the 3 in quotes...

Code:
char var;                         //<<<<<<<<<<<<<<< char not int
// blah
//blah
if(val == '3') {               // 3 in quotes '3'

And put a serial print in just after you read var, to see what IT actually is.....
813  Using Arduino / Programming Questions / Re: Program to store data on SD card not working on: December 28, 2013, 10:12:07 pm
CS is active low, so to me it seems as if this code actually switches the SD card off before it initialises it, by going high:

Code:
  /*Check to test the if the SD card is working*/
  digitalWrite (chip_sel, HIGH);   //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< try with this line out?
  if (!card.init(SPI_HALF_SPEED, chip_sel))
  {
814  Using Arduino / Programming Questions / Re: Tutorials? And what does the 'void' function mean? on: December 28, 2013, 02:48:27 pm
It depends entirely on what the function you write, needs to do. If it calculates the area of a circle it would need to be say a float, as in float calcCircleArea(rad), where the rad means you need to feed it the radius.

As a side note, the empty brackets on the end of setup() and loop() are actually implied voids too: no argument is passed to those functions, as if they were written void setup(void) and void loop(void).
815  Using Arduino / Programming Questions / Re: Controlling Micro Servo on: December 28, 2013, 02:37:17 pm
It's explained fully, with code, right here. You can show the servo position by just using Serial.println(val).
816  Using Arduino / Programming Questions / Re: Tutorials? And what does the 'void' function mean? on: December 28, 2013, 02:25:40 pm
In void setup() and void loop(), the void part just means that the function setup or loop don't return anything, ie sends no result back. On the other hand, if you wrote your own function to read a sensor, it would almost certainly need to give an answer, as in "return" one, say an integer. Then you would have, say int readMySensor()
817  Using Arduino / Project Guidance / Re: Arduino Project Book, Project 01, page 24 on: December 28, 2013, 01:50:31 pm
It's difficult to describe how far to push the wires in: it's a matter of "feel" I guess. If the insulation is cut back far enough, you'll probably hit the bottom of the hole which is ok. I only trim the wires if I'm making up something that might last on breadboard for a while, makes it a bit more secure. On the other hand you can't uncut a wire, and if you need the resistor to span a long way, well that's difficult if you cut it tpp short on a previous project. Only thing to watch out for, if you have long wobbly wires, is that they might by mistake touch other bare wires. That can be bad if it causes say a short from 5v to ground....

Don't worry about the colours of the wires, and yeah if you only have long ones left, well bend them. 

You don't have to connect the things exactly as the breadboard, as long as the circuit is the same. To start, I guess it's easier to follow the layout exactly, less scope for error. But remember that the 5 holes in a breadboard row are connected to each other, so you can jam a wire into a different hole in the same row if that's more convenient.

Main thing is to make sure that the circuit is electrically correct, even if it's physically off.
818  Using Arduino / Project Guidance / Re: Arduino Project Book, Project 01, page 24 on: December 28, 2013, 12:45:26 pm
Yes those are wires....
819  Using Arduino / Sensors / Re: IR - recieve(d) code(s) - howto use ??? on: December 28, 2013, 12:34:20 pm
I used the attached code to have a tv remote control a robot.... volume up was say speed up etc etc, using lines like this:

Code: ( Snippet. Full sketch attached)
void loop() {
  if (irrecv.decode(&results)) {
    Serial.println(results.value, DEC);
    irrecv.resume(); // Receive the next value
    
    //now act on various key presses
    
    // *********************** STOP
    if (results.value == 3148 || results.value == 1100) {  
      motorA_speed = 0;
      motorB_speed = 0;
      Serial.print("Stopping ");
      Serial.print(motorA_speed);
      Serial.print("\t");
      Serial.println(motorB_speed);
820  Using Arduino / Installation & Troubleshooting / Re: LED won't blink on: December 28, 2013, 12:23:43 pm
What value is that resistor?- I can't make out the colours....

If you have a multimeter, check that when the pin is high, you actually get 5V across the pin (or the end of the wire jammed into the pin) and ground.

Eliminate the wires and breadboard: Stick one end of the resistor into pin 13. Stick the cathode of the LED into the ground next door. Twist or just touch the resistor to the anode of the LED with the pin high.
821  Using Arduino / General Electronics / Re: How to sense Thermostat events with Arduino? on: December 28, 2013, 11:56:53 am
Just an observation: waaaaaay too much insulation stripped off those wires. The yellow and white are asking for a short...
822  Using Arduino / Networking, Protocols, and Devices / Realworld uses of Arduino as web server on: December 28, 2013, 11:53:08 am
What sorts of things are you guys and gals using Arduino web servers for, in real life?

I'm guessing remote monitoring and switching? Mostly domestic I expect? Aquaria, heating / cooling, security....

What clients are typical?- PC / laptop browsers, smartphones? Any roll-your-own? Other Arduina as clients?
823  Using Arduino / Programming Questions / Re: Creating my own functions on: December 28, 2013, 11:42:07 am
They say it's a sad day when we don't learn something...
824  Using Arduino / General Electronics / Re: wiring a potentiometer to 3 different lines on: December 28, 2013, 11:33:16 am
Quote
guess a fuse could be called a current sensitive resistor?

 smiley-cool A very Boolean one, though
825  Using Arduino / Programming Questions / Re: Creating my own functions on: December 28, 2013, 11:31:21 am
@RoyK, you can't do any highlighting inside the code tags...
Pages: 1 ... 53 54 [55] 56 57 ... 225