Show Posts
Pages: 1 2 [3] 4 5 ... 252
31  Using Arduino / Project Guidance / Re: Could I connect multiple 8x8 LED matricies (w/ MAX2719)? on: September 13, 2014, 07:43:39 pm
Easy, each one has 5 pins at the top and bottom.

(Top) VCC, GND, DOUT, CLK and CS.
(Bottom) VCC, GND, DIN, CLK and CS

All the CLK must be connected, as well as all the CS, top or bottom, it doesn't matter. What does matter is the DIN and DOUT pins, the first DIN will come from the Arduino, and then all the rest get DOUT(first display) -> DIN(second display), then DOUT(second display) -> DIN(third display) ... and so on.

These do take a bit of power each, so having multiple connected will take even more so, what you should do is power them with a good 5V wall charger at +700mA .

To get them to work you can either write the code yourself using shiftOut() or one of the already made libraries. (Search arduino 8x8 Dot matrix library)

I use LEDControl found HERE
32  Using Arduino / Project Guidance / Re: Working with RF Module on: September 13, 2014, 06:54:04 pm
Those don't use the virtual wire library, they are actually very straight forward. If you set D0 on the transmitter side to HIGH, then D0 on the receiver side will be HIGH.

What are you trying to do with them exactly, what is being controlled?
33  Using Arduino / Programming Questions / Re: Expected Unqualified-Id Before ')' Token on: September 12, 2014, 06:22:49 pm
You need to call your functions with () on the end of them, not just local; or auto;
34  Using Arduino / Programming Questions / Re: Programming Help. Dice game. on: September 12, 2014, 04:23:02 pm
Try this.

Code:
int LEDRED = 11;
int LEDGREEN = 9;
int counter = 0;

void setup ()
{
  Serial.begin(9600);
  randomSeed(analogRead(0)); //Seed the random number generator
  pinMode(LEDGREEN, OUTPUT); // Configure green LED
  pinMode(LEDRED,OUTPUT); // Configure red LED
  digitalWrite(9, LOW); // Making sure the green LED is off
  digitalWrite(11, LOW); // Making sure the red LED is off
  Serial.println("Welcome to the dice game!");
}

void loop()
{
  int answer;
  int user;
  int computer;

  Serial.print('\n');
  Serial.print("Want to play? (1 = yes, 2 = no)");
  while(Serial.available() <=0); //Waiting while the user inputs vaule

  digitalWrite(9, LOW); // Making sure the green LED is off
  digitalWrite(11, LOW); // Making sure the red LED is off

  answer = Serial.parseInt(); //Recieves the vaule from the user
  switch(answer)
  {
  case 1:
    if(counter < 3) // regular
    {
      user = random(1,7);
      computer = random(1,7);
    }
    else
    {
      user = random(4,7);
      computer = random(1,3);
    }

    Serial.print('\n');
    Serial.println("The user rolls a");
    Serial.println(user);
    Serial.println("The computer rolls a");
    Serial.println(computer);

    if(user > computer)
    {
      counter = 0;
      Serial.println("You win!!!!");
      digitalWrite(LEDGREEN, HIGH);
      delay(3000);
    }

    else if(user < computer)
    {
      counter ++;
      Serial.println("You loose, Computer wins!");
      digitalWrite(LEDRED, HIGH);
      delay(3000);
    }
    else /*if(user ==computer)*/ // not needed anymore
    {
      counter =0;
      Serial.println("It's a tie!");
      digitalWrite(LEDRED, HIGH);
      digitalWrite(LEDGREEN, HIGH);
      delay(3000);
    }
    break;

  case 2:
    Serial.print('\n');
    Serial.print("You've hurt my feelings, I really wanted to play :/");
    break;

  default:
    Serial.println("Invalid response, please enter a 1 or 2");
  }
}
35  Using Arduino / Programming Questions / Re: Strange conflict between SdFat.write() and Serial.print() on: September 12, 2014, 04:10:25 pm
I'm not sure if this will make a difference, but you can try to put your strings in the flash memory with F().

Example:
Code:
Serial.print(F("got array [")); Serial.print(sample_arr); Serial.println(F("]"));
36  Using Arduino / Programming Questions / Re: Programming Help. Dice game. on: September 12, 2014, 04:01:40 pm
Post your code, and please use code tags, its the # symbol above the smiley face.
37  Using Arduino / Programming Questions / Re: Programming Help. Dice game. on: September 12, 2014, 03:53:29 pm
Quote
reseting to zero every time the game loops?
It should only reset when the user wins.
38  Using Arduino / Programming Questions / Re: Programming Help. Dice game. on: September 12, 2014, 03:09:15 pm
Now when I place that in my code where would I place it? I would want it before the void loop, so I am thinking in the void setup?

It's practically already in your code, you just need to figure out where that is. (Hint: When the computer wins, counter++, when the user wins counter = 0.)

All you need to do after is have an if statement that sees if the user has lost 3 times and then on the next game, the user wins.

Quote
so I am thinking in the void setup?
A whole lot of good that will do for you. smiley-wink
39  Using Arduino / Programming Questions / Re: Programming Help. Dice game. on: September 12, 2014, 03:02:29 pm
(face palm)
Do you know how to increment a variable (byte) by 1, and set it back to zero? If so you can use this to make a simple counter.

if( /*condition*/) // what condition would you put in here to see if the user has lost?
{
  //conditions is true
  counter++;
}
else // user has won, reset the counter to zero
{
  //condition is false
  counter = 0;
}
40  Using Arduino / Project Guidance / Re: Servo agitating water? on: September 12, 2014, 02:57:36 pm
Three Stooges re-runs  smiley-grin, im only 24.
41  Using Arduino / Programming Questions / Re: Programming Help. Dice game. on: September 12, 2014, 02:54:42 pm
Please look at number 6, bullet point 6 of first post in this thread. Read this before posting a programming question

Where is the counter that keeps track of the number of times the user has lost?
42  Using Arduino / Programming Questions / Re: Programming Help. Dice game. on: September 12, 2014, 02:48:33 pm
Do you have an arduino to upload the sketch to and two different color LEDs? If so, run the sketch and use the serial monitor as the interface.

43  Using Arduino / Project Guidance / Re: 4x4x4 cube code help on: September 11, 2014, 08:17:32 pm
Hmmm, thats weird, the only error I get is
Quote
Binary sketch size: 1,570 bytes (of a 30,720 byte maximum)

Oh wait, I modded my library smiley-sweat,  in the original files,  prog_uchar and the rest of them have been depreciated.

Change prog_uchar to const unsigned char
44  Using Arduino / Project Guidance / Re: Servo agitating water? on: September 11, 2014, 04:28:33 pm
Agitating the water how? Waves or some kind of propeller?

You could have the servo move a bobber up and down to create ripples, or you can get a continuous rotating servo to turn a propeller.

You can also have the servo rotate a weight that vibrates the water container.
45  Using Arduino / Project Guidance / Re: Sound Balls on: September 11, 2014, 04:25:51 pm
Does each ball of the same size make the same sound? What about if two different ball sizes collide, do you hear two different sounds or just one based on the combination?
Pages: 1 2 [3] 4 5 ... 252