Show Posts
Pages: [1] 2 3 ... 136
1  Community / Bar Sport / Re: Angle Trisection Approximation on: May 24, 2011, 09:29:43 am
Thank you!

I used GeoGebra. It's really awesome for construction smiley

Code:
float trisect(float angle)
{
  static const int COMPASS_AND_STRAIGHTEDGE = 3;
  return angle / COMPASS_AND_STRAIGHTEDGE; //trisect using only compass and a straightedge
}
2  Community / Bar Sport / Angle Trisection Approximation on: May 24, 2011, 12:05:19 am
Hello!

Trisecting an angle using compass and straightedge (well... almost anyways).


Care to review?

Thanks!
3  Using Arduino / Programming Questions / Re: Keypad on: April 03, 2011, 04:31:20 pm
http://arduino.cc/playground/Main/KeypadTutorial

Did you read that?
4  Using Arduino / Programming Questions / Re: Returning reference on: March 23, 2011, 09:19:25 am
noInterrupts();
x = GetWeeklyHours();
interrupts();

It's simply that cool, to return things by reference. Especially when it's done for no apparent reason at all.
 smiley-cool
5  Using Arduino / Programming Questions / Re: Returning reference on: March 23, 2011, 05:55:52 am
You are correct. But that will probably work because what really happens is a value copy.
If you were to save the pointer to that float (and mess with the stack [say, creating a new variable]) it will be corrupt when you try to use it.
6  Using Arduino / Programming Questions / Re: Static member of a class impossible?! Same fate as the Processing?! on: March 11, 2011, 12:10:01 am
They're possible!
Code:
//header
class Test {
  static int x;
};

//implementation
int Test::x = 0;
7  Using Arduino / Programming Questions / Re: Understanding this line " ? HIGH : LOW; " on: March 09, 2011, 04:22:22 pm
I would say that the init handles things that you normally have to worry about on other platforms, but the Arduino does some things behind the scenes.
The init is an important part of this 'behind the scenes' and you should be thankful it's there. You normally do not need to know what it does.

The only thing to know, is that there are some things you can not do before the init has been called, so when the time comes fro writing libraries/classes then you need to refrain from doing certain things in the constructors as they might run before init has.
8  Using Arduino / Programming Questions / Re: Understanding this line " ? HIGH : LOW; " on: March 09, 2011, 04:07:35 pm
Here is the Arduino equivalent:
Code:
void setup() {
  Serial.begin(9600);
  Serial.println("HEY, you, I'm alive! Oh, and Hello World!");
}

void loop() { /*nothing to do in the loop*/ }
9  Using Arduino / Programming Questions / Re: Trouble with Trigger/ADC on: March 08, 2011, 08:03:17 pm
 exitFunct = 1;
  while(exitFunct);

Waste of time, just let the function return.

I suspect that is the point exactly. ?
10  Using Arduino / Programming Questions / Re: 9 DAYS TO DEADLINE - Tone.h + PWM = not working on: March 08, 2011, 02:04:27 pm
http://www.arduino.cc/en/Reference/Tone
Quote
Use of the tone() function will interfere with PWM output on pins 3 and 11 (on boards other than the Mega).
11  Using Arduino / General Electronics / Re: How to wire something that draws a lot of current to the Arduino on: March 08, 2011, 01:31:12 pm
Thank you RC!
12  Using Arduino / General Electronics / How to wire something that draws a lot of current to the Arduino on: March 08, 2011, 01:24:40 pm
I can't belive I'm asking this, but; can I supply the Arduino with an external adapter of say 1 ampere, and then connect something to the Arduino that draws 1A, or do I need to wire a separate power supply to that device only, and then share grounds?
 smiley-red
13  Using Arduino / Programming Questions / Re: Sending and Receiving Multiple Variables from a Function on: March 07, 2011, 01:02:16 pm
You do
need to send memory pointers like I'm used to (&variable1, or use *variable1)?
14  Using Arduino / Programming Questions / Re: Beginning Arduino; Some Basic Questions on: March 03, 2011, 09:05:34 pm
You program the Arduino in C++ (a superset of a subset) and the editor you write the Arduino code in, that is written in Java.

To 'stop a program' you simply enter an infinite loop (or a loop that you can break out from when you decide).
Code:
void haltProgram() {
  while (true) {}
}
A call to haltProgram() will seemingly stop the execution, but the CPU will execute a No OPeration for ever.
15  Using Arduino / Programming Questions / Re: Type 'double' is not assignable to 'int' on: March 03, 2011, 03:22:49 pm
The poll says it all.
Pages: [1] 2 3 ... 136