Show Posts
Pages: 1 ... 4 5 [6] 7 8 ... 96
76  Using Arduino / Programming Questions / Re: prototype function error on: June 30, 2014, 10:24:39 pm
Try spelling receivemsg correctly.  <"I" before "E", except after "C">
Like "science", "efficient", "species"... smiley-wink
I heartheir are exceptions.  smiley smiley
77  Using Arduino / Programming Questions / Re: need a delay on a release of a button on: June 30, 2014, 10:14:08 pm
I know this is not the right way but for me it did the trick i think smiley-lol
if ((digitalRead(3)==LOW)&&(digitalRead(13)==HIGH))
{digitalWrite (13,HIGH);  //why do you need this line?
 // You've already established, in the if statement, that it's HIGH.
// If it was LOW, you'd never get here.
digitalWrite(13, LOW);

78  Using Arduino / Programming Questions / Re: How to make a variable stay true without delay on: June 30, 2014, 10:01:11 pm
@Henry_Best - oh, really? what is the difference, I thaught that were just 2 ways of
writing the same thing...
They are exactly the same, but the way I showed is easier to see and understand what is supposed to be happening.
It's also less typing.   smiley smiley
79  Using Arduino / Programming Questions / Re: Is it possible to re-#define something? on: June 30, 2014, 09:46:16 pm
My question is, can I just throw that #define in my main program after my includes, possibly #undef -ing it first, and have the compiler use that new definition everywhere, or am I going to have to alter wiring.c, which I'd prefer not to do because the modification will affect other projects and will inevitably be lost and forgotten when I back up my project folder?
Why not save the modified file under a different name, such as mywiring.c, so that it doesn't overwrite the original wiring.c and affect other projects?
80  Using Arduino / Project Guidance / Re: Uuuuuubbbber Newbie on: June 30, 2014, 09:25:08 pm
If the item is picked up, then the alarm will sound, but I plan to make the base out of steel, so including a pressure switch might be tricky.
A tilt/trembler switch would probably do the trick. What is the tube made of?
81  Using Arduino / Project Guidance / Re: Uuuuuubbbber Newbie on: June 30, 2014, 08:59:29 pm
6) Define your thumbswitch. Will it be an edgewise rotary switch or a micro joystick (the sort of thing used on old laptops to control the cursor position) ?
A slide switch? or a rotary sounds like it might work, but something that is very unobtrusive, and easy to hide.
Using a slide or rotary switch will mean that switching, say, from the first position to the last will mean that every intermediate position will be passed through and, therefore, you'll need some method of 'blanking' the intermediate connections. You don't want the alarm going off, even for a short while, when you're just trying to switch on the LEDs. That might would give the game away.  smiley-wink
Does the magician wear gloves during the act? If so, you can hide a small magnet in one and use hall effect sensors to detect where the wand is being touched. Nobody examining the wand will see any sort of switch or contact, nor be able to change the settings. No gloves? Then how about a 'magic' ring with a magnet hidden inside it? Or simpler still, use an ordinary ring to bridge two contacts. The contacts will be visible, but can be disguised.

EDIT: Obviously, you'll not be able to use the magnet/hall sensor if the tube is iron or steel.
82  Using Arduino / Project Guidance / Re: Whiskey dispenser on: June 30, 2014, 08:26:12 pm
That sounds somewhat like my initial attempt, although I raised the long tube above the level of the bottle, as I could not get it sealed. Getting a two-hole stopper that also attaches to a bottle is quite difficult - but if I could get hold of such a thing, it would be a nice way to do it smiley
I'm not sure if silicone rubber is food safe, but you can get silicone rubber bungs and a special cutter to make the holes. The cutter is a steel tube with one end sharpened so as to remove a 'plug' of rubber. You have to use the cutter, as drilling will leave rough edges that will leak.
83  Using Arduino / Project Guidance / Re: Is there any way to send electricity (multiple circuits) though a spinning axle? on: June 30, 2014, 06:41:42 pm
You can make your own slip rings with a plastic rod and some brass rings.
Or use a 3 ring and tip 3.5mm jack plug and socket, the sort used on smartphones.
84  Using Arduino / Project Guidance / Re: IC pin 1 placement convention? on: June 29, 2014, 11:55:00 pm
But what do you do if you need to have some vertical and some horizontal?  smiley-confuse
Well, then you turn it 45 degrees and compromise  smiley-razz
But where can I buy a 45o breadboard and some 45o strip-board?
You're up early- off the the tennis?
Nope. I'm an insomniac. I'm up late! Tennis is boring.
85  Using Arduino / Programming Questions / Re: How to make a variable stay true without delay on: June 29, 2014, 11:41:29 pm
   if (pressed == false){
    if (lastButtonState == HIGH){
    if (buttonState == LOW) {    
    unsigned long startTime = millis();
    pressed = true;
Contracts to:
  if (pressed == false && lastButtonState == HIGH && buttonState == LOW) {     
    unsigned long startTime = millis();
    pressed = true;
&& = logical AND.
86  Using Arduino / Programming Questions / Re: different LED patterns using millis() on: June 29, 2014, 11:26:11 pm
Also, I am still learning when to use = as opposed to ==. 

one way to help you is to put the constant in front if possible (real constant or a const var)

if (a == 4) ... will compile
if (a = 4) ... will compile (but is probably wrong)
if (4 == a) ... will compile
if (4 = a) ... will not compile
A handy tip, Rob, but of no use when comparing two variables. 
if (a==b)...
87  Using Arduino / Programming Questions / Re: prototype function error on: June 29, 2014, 11:06:36 pm
I have this header  in my project:
it's supposed to read and write data across two different Arduinos using the analog voltage range, and when I verify/compile the project it returns only 2 errors from that header: 

In file included from uno_ver.ino:4:0:
arduinoshare.h:14:12: error: variable or field ‘start’ declared void
arduinoshare.h:20:18: error: variable or field ‘recievemsg’ declared void
Try spelling receivemsg correctly.  <"I" before "E", except after "C">
88  Using Arduino / Programming Questions / Re: L293d Dual Motor Control on: June 29, 2014, 10:58:46 pm
1) You need to post your code between [ code] [ /code] tags. Use the # button above the smileys.
2) You can only have one setup() and one loop() in any program.
3) You need to get rid of your delay()s. See the 'blink without delay' example in the IDE (File > Examples > > blinkwithoutdelay). Your Arduino can't do anything else when it's in a delay.
4) Look up 'Finite State Machine' for how to order your code, so that it follows a logical, easy to understand, sequence.
89  Using Arduino / Project Guidance / Re: IC pin 1 placement convention? on: June 29, 2014, 10:29:16 pm
When ICs are vertical, I guess it's normal to have the notch at the top- pin 1 top left.
Normal, but not always practical.
But if an IC is horizontal- as is often the case with a long breadboard across one's desk- is there a convention for placing the notch at left or right?
The convention is to keep them all the same way round. But if the board gets turned through 180o, all your ICs will be facing the other way.  smiley
I've an old board on my desk (Seikosha) with, if I keep the silkscreen the right way up, the power coming in from the right and all ICs with their notch on the left. But what do you do if you need to have some vertical and some horizontal?  smiley-confuse
90  Using Arduino / Project Guidance / Re: KVM over IP with arduino? on: June 29, 2014, 09:57:55 pm
But how can I capture the VGA output?

I'm aware that that might be not so strait forward as this are really big data rates.
But if I say 1 frame per second would be enough that should be doable in somehow?
How to do that?

Any advice would be greatly appreciated.
Say you're using a low screen resolution of 800 * 600 and 256 (16 bit) colours. That's 7.68Mb of data that you want to send in 1 second through a microcontroller operating at 16MHz. Probably impossible, especially if you want the Arduino to do other things at the same time or need a higher screen and/or colour resolution. I don't know anything about them, but a Raspberry Pi might be a better solution.
Pages: 1 ... 4 5 [6] 7 8 ... 96