Show Posts
Pages: 1 ... 4 5 [6] 7 8 ... 72
76  Using Arduino / General Electronics / Re: powerswitch wires on: March 26, 2014, 12:48:14 am
Have you tried swapping the connections to A and 3?
77  Using Arduino / Programming Questions / Re: any code for arduino to stop servomotor ? on: March 26, 2014, 12:21:56 am
Use a flag.
Code:
boolean motorAt90 = 0; // false
...
void loop(){
 if(motorAt90 ==0){
    move motor to 90Degs;
    motorAt90 = 1;  //true
  }
}

   
78  Using Arduino / Programming Questions / Re: Help in while, if & else on: March 26, 2014, 12:12:32 am
sorry man i am new to this its something like that
i want to ask is how to add other button to with different time.
Get rid of the delays. Look up the 'blink without delay' example in the IDE and Finite State Machine.
79  Using Arduino / Programming Questions / Re: Does delay stop Millis on: March 26, 2014, 12:06:10 am
So I know that when you use delay it stops the code from running for that long. But does delay also stop the internal clock that counts millis?
No, but if you're using millis() to time events, when delay() ends you may have missed an event.
80  Using Arduino / Project Guidance / Re: Automated Chicken Feeder - Noob needs help on: March 25, 2014, 11:57:46 pm
More suitable would be http://www.jaycar.com.au/productView.asp?ID=YG2730. I would use limit switches instead of time to control its position. Just run it until it hits the limit switch, wait for 2 seconds and then reverse it until it hits the other limit switch. You might find problems closing the shutter against the flow of feed. Some feed may get trapped and stop the shutter from fully closing.
81  Using Arduino / Project Guidance / Re: Counter/timer questions on: March 25, 2014, 11:40:25 pm
Thank you for interest.

Pushing a button gives timer1 value:
timer1=millis()+3600000;
That's not in the code you posted above. I'm not a mind reader.
I suggest you look at the 'blink without delay' example in the IDE and also 'Finite State Machine'.
82  Using Arduino / Project Guidance / Re: Absolute noob needs help on: March 25, 2014, 11:32:23 pm
Hi, go back and edit your subject, Absolute noob doesn't tell us a thing about what you want.

Edit to,   "Autonomous metal detecting vehicle" that way people might be encouraged to read your plea for help.
Especially, it might encourage those with some experience/knowledge of autonomous metal detecting vehicles to reply.
Quote
Is this a school project or just one you are playing with?
Assuming the 92 in his nym is the year of his birth, then I'd expect that this is a university/college project.

83  Using Arduino / Project Guidance / Re: Counter/timer questions on: March 25, 2014, 11:13:08 pm
Code:
  aeg1=timer1-millis();
As you've not given timer1 a value it will be 0 by default. millis() is the number of milliseconds since the Arduino was powered up/reset. So you're taking an almost random number away from zero which will leave aeg1 as a negative number. Therefore,: 
Code:
  if (0 <= aeg1)
will always be false. What, exactly, are you trying to do here?
84  Using Arduino / Project Guidance / Re: Using the Digital Ouput to provide a ground signal on: March 25, 2014, 10:07:28 pm
Hi!  Just getting started in this - don't know if I'm going up the wrong tree.  I want to use a program to make 12 volt light blubs blink.
Perfectly possible with an Arduino. 
Quote
The bulbs have 12 volts wired to them
I presume these are filament bulbs and not LEDs
Quote
- can I get a ground to each bulb using the digital output port on the Arduino.
Not the way to do it. You'll have to use a transistor to switch each bulb on/off, as each output pin on an Arduino can only supply 40mA.  Not enough for a filament bulb.
Quote
I have not purchased one yet - thought it would be a good idea to see if this is possible.
You'll not be able to blink filament lamps quickly, as they take time to reach full brightness when you turn them on and time to stop shining when you turn them off. Fast blinking will make them give a continuous dull light,
85  Using Arduino / Programming Questions / Re: TVout demo not compiling on: March 25, 2014, 12:25:44 am
Not quite, the class modification is fine, except for the return:
Quote
class pollserial : public Print {
   public:
      pt2Funct begin(long);
      void end();
      uint8_t available(void);
      int read(void);
      void flush(void);
      virtual size_t write(uint8_t);
      using Print::write; // pull in write(str) and write(buf, size) from Print
                return 0x01;
};

In the location where the class functions are defined ( with code between {} ) you need to modify the function.

Maybe in pollserial.cpp there should be something that resembles the function below.
Code:
void pollserial::write(uint8_t){
  //some code
}

you need to modify it to look like:
Code:
size_t pollserial::write(uint8_t){
  //some code
  return 0x01;
}
Thanks very much, pYro
86  Using Arduino / Programming Questions / Re: TVout demo not compiling on: March 24, 2014, 10:02:45 pm
Quote
        I think he means this
Code:
class pollserial : public Print {
public:
pt2Funct begin(long);
void end();
uint8_t available(void);
int read(void);
void flush(void);
virtual size_t write(uint8_t);
using Print::write; // pull in write(str) and write(buf, size) from Print
                return 0x01;
}; 
That causes even more errors!
87  Using Arduino / Programming Questions / Re: TVout demo not compiling on: March 24, 2014, 12:21:48 pm
Goto Pollserial.h, on line 46 change virtual void to virtual size_t.
Also inside the function you need to return 0x01

When Arduino was upgraded to verison 1.0 the Print library was modified. Your library is a pre 1.0 version.
Thanks, pYro, but I'm not certain what you mean by
Quote
Also inside the function you need to return 0x01
Here's the original code:
Code:
/*
  pollserial.h Heavily modified version of:

  HardwareSerial.h - Hardware serial library for Wiring
  Copyright (c) 2006 Nicholas Zambetti.  All right reserved.

  This library is free software; you can redistribute it and/or
  modify it under the terms of the GNU Lesser General Public
  License as published by the Free Software Foundation; either
  version 2.1 of the License, or (at your option) any later version.

  This library is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  Lesser General Public License for more details.

  You should have received a copy of the GNU Lesser General Public
  License along with this library; if not, write to the Free Software
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
  Modified July 2010 by Myles D. Metzler
*/

#ifndef PSERIAL_H
#define PSERIAL_H

#include <inttypes.h>
#include "Print.h"

typedef struct {
uint8_t head;
uint8_t tail;
unsigned char * buffer;
} rbuffer;

//define a void function() return type.
typedef void (*pt2Funct)();

class pollserial : public Print {
public:
pt2Funct begin(long);
void end();
uint8_t available(void);
int read(void);
void flush(void);
virtual void write(uint8_t);
using Print::write; // pull in write(str) and write(buf, size) from Print
};

void USART_recieve();
#endif
88  Using Arduino / Programming Questions / TVout demo not compiling [Fixed] on: March 24, 2014, 12:32:01 am
I've placed all the header files in the libraries folder but get the following errors:
Code:
In file included from C:\Users\Henry\Documents\Arduino\libraries\TVout\pollserial.cpp:28:
C:\Users\Henry\Documents\Arduino\libraries\TVout\/pollserial.h:46: error: conflicting return type specified for 'virtual void pollserial::write(uint8_t)'
C:\Program Files\Arduino\hardware\arduino\cores\arduino/Print.h:48: error:   overriding 'virtual size_t Print::write(uint8_t)'
Is this something stupid that I've (not) done (more than likely) or is it an error in the TVout code?

Also, how can I get to see ALL the tabs when some are off the RHS of the IDE screen? I can't find how to scroll through them.
89  Topics / Product Design / Re: Arduino Dial Up Modem shield on: March 24, 2014, 12:14:46 am
I've no use for one, but it looks a very good idea. With it, you'd be able to have a remote Arduino automatically 'phone home' to upload collected data. But couldn't a USB shield, with a USB mobile [cell] phone dongle do the same job?
90  Using Arduino / General Electronics / Re: Simulate rubber button on: March 23, 2014, 11:51:25 pm
What voltage does the equipment use? What is the voltage across each of the open switches?
Pages: 1 ... 4 5 [6] 7 8 ... 72