Show Posts
Pages: 1 2 [3] 4 5 ... 24
31  Using Arduino / Programming Questions / Re: Mouse keep alive on: February 13, 2013, 09:21:32 pm
This was the very first thing I made when I got some Teensies, and it gets used routinely at our house using different laptops/netbooks plugged to the TV for netflix etc.  I just leave it by the TV.

* Some pc's the screensave/power managment settings don't work (Ubuntu)
* Some pc's they are locked out by group policy (e.g. my company laptop)
* For some of my kids they just find it easier to plug in the TV, plug in the Dongle
* Why ask why?

Cheers,
John

(Ps moving a few pixels and then back every 10 minutes does not seem to interfere with normal mouse use, even if you forget to take it out )

32  Using Arduino / Programming Questions / Re: Using other IDEs to develop on: February 13, 2013, 09:09:21 pm
I sometimes/often use Eclipse CDT and like it a lot.  It was not very hard to install and configure the http://www.baeyens.it/eclipse/ plugin.

The CDT has the native g++ toolchain with it already.  So you can often write/run/test/debug/simulate difficult parts of your code on your pc, and then copy or "link" into your Arduino project.

It's amazing how helpful are the features are like autocomplete, F3 "zoom-to-definition", ctrl-tab switch between cpp and header, etc!

Cheers,
John
33  Using Arduino / Programming Questions / Re: random void? on: February 13, 2013, 08:57:19 pm
Maybe something like this?

Code:
int pick( int a, int b)
{
   return random(2) ? a : b ;
}

void loop() {
  static int next;

  lcdscreen();

  switch (next) {
   case 0: redlight();   next= pick( 1,2);  break;
   case 1: bluelight();  next= pick( 0,2);  break;
   case 2: greenlight(); next= pick( 0,1);  break;
   }

}


if you don't want It to produce the same pseudo-random sequence each time you boot/power it-- see http://arduino.cc/en/Reference/random

Cheers,
John
34  Using Arduino / Programming Questions / Re: Error: "has not been declared" on: February 12, 2013, 12:00:07 am
Any idea about the original question though?

Quote
Any idea about the original question though?
I'd be interested in investigating further, if only you had posted ALL of your code.

I'm not the OP.

Is there a forum setting that automatically removes the author when quoted?  --Or do you do that explicitly each time you reply.
35  Using Arduino / Programming Questions / Re: moisture sensors on: February 11, 2013, 11:46:44 pm
its still flickering.....yes i run one pump and four valves , the pump and valve are suppose to turn on when the the sensor is dry..

Think about if some of the four sensors are dry and others are wet...

Your code:
The dry ones are telling the pump "turn on!"
The wet ones are telling the pump "turn off!"

If I was the pump I would probably be flickering too smiley

John
36  Using Arduino / Programming Questions / Re: Error: "has not been declared" on: February 11, 2013, 06:59:47 pm
Any idea about the original question though?
37  Using Arduino / Programming Questions / Re: openpipe with fluxamasynth on: February 11, 2013, 06:27:48 pm

should I delete this to?

the question really is, should I add any thing?


I don't think that will matter.  Also, the instrument=0 will not matter because it is not being used anywhere either.

Sorry, I don't know anything about the shield or Midi.

And, what is your thinking about the "VS1053 reset line"?

Cheers,
John
38  Using Arduino / Programming Questions / Re: openpipe with fluxamasynth on: February 11, 2013, 05:48:12 pm
Then look at every function that ends in
Code:
Serial.write(midiMsg.raw, sizeof(midiMsg));
And delete the whole of the function.

Any calls to these deleted functions should be replaced to the other set of midi out functions you have in that sketch.

None of those three errant functions are actually being called in the sketch anyway...
39  Using Arduino / Programming Questions / Re: moisture sensors on: February 11, 2013, 02:12:18 pm
I count 1 pump and 4 valves.

(1) Do you want the pump to turn on when any of the four moisture sensors are dry?
(2) Do you want the pump to turn off when any of the four moisture sensors are wet?

It looks to me like your code is doing both (1) and (2).

Cheers,
John
40  Using Arduino / Programming Questions / Re: moisture sensors on: February 10, 2013, 10:54:59 pm
Not sure what you are thinking here but am pretty sure it's not right smiley
Code:
const int PROBE = A0-A4; // Analog pin 0-3
...

void setup() {
   pinMode(PROBE,INPUT);
   ...
}

Maybe you want
Code:
const int PROBE1=A0, PROBE2=A1, PROBE3=A2, PROBE4=A3;

pinMode( PROBE1,  INPUT);
pinMode( PROBE2,  INPUT);
... etc

But, I would recommend getting ONE of them working before writing all that non-working code for FOUR...

And then you can learn about arrays to expand for the other three smiley

Cheers,
John
41  Using Arduino / Programming Questions / Re: Reading html data only, storing as String on: February 10, 2013, 05:21:29 pm
Let's say you are able to get it into a string like "68.00, 1, 0, 1, 1, 66.00, 0, 0, 5, 23, 20, 0".  What are you going to do with it then?



42  Using Arduino / Programming Questions / Re: Reading html data only, storing as String on: February 10, 2013, 01:47:55 pm
In the below string you already have the start of data marker colon : and end of data marker comma ,.

There will also be these colons and commas that need to be "bypassed"  though:
Code:
Cache-Control: no-store, no-cache, must-revalidate
43  Using Arduino / Programming Questions / Re: Reading html data only, storing as String on: February 10, 2013, 01:45:09 pm
For such a simple parsing requirement I'd just process the input stream one character at a time, looking for the opening brace ('{').

Once found, process each subsequent character, probably in a switch statement:

If it's a decimal digit or a period, append to a buffer holding the current input field.
If it's a closing brace ('}'), the input line is complete. Save the content of the buffer (if any) and end the parsing.
If it's any other character, save the content of the buffer (if any) and reset the buffer ready for the next field.

I agree with this except it's a little bit harder, because he has nested curlies {,,,{,,,}}
44  Using Arduino / Programming Questions / Re: Passing a function another function on: February 10, 2013, 11:57:00 am
I worked your code into mine Johncc, and it is telling me
Code:
barbotV18:40: error: variable or field 'checkglass' declared void
barbotV18:40: error: 'drinkfunction' was not declared in this scope
How should I declare drinkfunction- what type of pointer is it?

Hmm, my code should translate directly into yours, with names of your choosing.  If you don't want to post your whole code, probably need to post at least your:

typedef
function prototype
declaration of drinkFunction
declaration of checkglass
code that calls checkglass

John
45  Using Arduino / Programming Questions / Re: Delay question on: February 10, 2013, 09:25:55 am
Where would you suggest I look for TimeAlarms library info?

Google?  smiley

TimeAlarms is included in the Time library:
Code:
http://playground.arduino.cc/Code/time

Unfortunately the playground does not include documentation for it though.  But see the example sketch--and the readme file in the library folder that you install.

And google.  http://www.lmgtfy.com/?q=arduino+timealarms

Cheers,
John
Pages: 1 2 [3] 4 5 ... 24