Show Posts
Pages: 1 2 [3] 4 5 ... 278
31  Using Arduino / Programming Questions / Re: reading CD4021BE shift in register on: June 09, 2014, 06:11:29 pm
Code:
  mainMenu();
  {
What's with the extra level of { ... } ?  Not that it makes any functional difference, but it's just confusing to read.

Quote
I don't understand whats going on here
What *is* going on here?  What are the results you are currently seeing?
32  Using Arduino / Programming Questions / Re: reading CD4021BE shift in register on: June 09, 2014, 05:18:12 pm
Well, that's not what it's doing.

*      for (int n=0; n<=7; n++)
Do this 8 times:

 *   if (dataPin = 2)
Did I set the variable dataPin to the value 2? Of course I did.

*      lcd.setCursor(0,1);
*      lcd.print(Symbol_2);
Set the cursor to 0,1 and print Symbol_2

dataPin is a variable used (by the looks of things) to define which pin is used as the serial data input for the shiftIn() function.  You are then assigning it the value "2" and at the same time checking if you assigned it a value of anything other than 0 (btw, = is assign, == is compare).  I don't think you want to be ever touching dataPin (you should set it as a const so the compiler will complain if you do something silly like that), but you want to be looking at the results of the shiftIn() call.
33  Using Arduino / Programming Questions / Re: Stuck in a print loop and can't unplug because it starts printing as soon as I on: June 09, 2014, 05:12:59 pm
Follow these instructions (From the ESPLORA page) precisely step by step.  Does it not work?
Quote
5 | Programming the board

Double-click the Arduino application. (Note: if the Arduino software loads in the wrong language, you can change it in the preferences dialog. See the environment page for details.)
Open the Esplora Blink example

Open the LED Blink example sketch: File > Examples > Esplora > Beginners > EsploraBlink.

Note: If you do not see the EsploraBlink example, you may need to update the Esplora library. To do this, quit the Arduino IDE and download this .zip file. When you unzip it, you'll have a folder called Esplora. Look in your Documents folder (on OSX or Ubuntu) or My Documents folder (on Windows) for the Arduino sketches folder. It will be called "Arduino" and there should be a folder inside called "libraries". If not, create a libraries folder inside the sketches folder. Move the Esplora folder into the libraries folder. Then re-start the Arduino IDE. Now you should be able to open the EsploraBlink sketch as described above.
Configure Arduino for Esplora

Since the Arduino IDE is used for many different Arduino boards, you need to tell it that you're working with the Esplora. Open the Tools > Board menu and choose Arduino Esplora.
Select the right USB port

The Arduino IDE needs to know which of your USB ports the Esplora is connected to. The Tools > Serial menu lists the available ports:

    if only one item is shown, click on that one;
    if two or more are shown, you can disconnect the Esplora and re-open the menu; the entry that disappears should be the Esplora board. Reconnect the board and select that serial port.

Upload the program

Now, simply click the "Upload" button in the environment. Wait a few seconds - you should see the RX and TX leds on the board flashing. If the upload is successful, the message "Done uploading." will appear in the status bar of the software.

A few seconds after the upload finishes, you should see the yellow RGB LED on the board start to blink, changing color from red to green to blue to yellow to cyan to magenta to white. If it does, congratulations! You've gotten Esplora up and running.
34  Using Arduino / General Electronics / Re: Use of capacitor(??) on: June 09, 2014, 04:56:55 pm
It's a low-pass filter at 1.59154943092Hz.

Quite why he's doing it that way I'm not sure - just pure PWM would suffice.

Clearly its a computer fan which is a motor-controller circuit plus brushless motor
that runs from a DC supply - the low pass filter means the motor controller gets
a constant supply (no guarantee it would work PWM'd).  That transistor is operating
in the linear region and will dissipate heat BTW.

Which is why good computer fans have 4 wires, not 3 - Vcc, GND, Tach and *PWM*.  The best thing you can do is get a proper fan...
35  Using Arduino / Programming Questions / Re: reading CD4021BE shift in register on: June 09, 2014, 04:54:20 pm
Code:
void loop()
{
  mainMenu();
  {
      for (int n=0; n<=7; n++)
  {
    if (dataPin = 2)
    {
      lcd.setCursor(0,1);
      lcd.print(Symbol_2);
    }
  }
  }
}
What do you think this bit is supposed to be doing?
36  Using Arduino / Programming Questions / Re: Stuck in a print loop and can't unplug because it starts printing as soon as I on: June 09, 2014, 04:49:24 pm
I'm sorry... type something...?

I think we have crossed wires here.  You don't type anything to upload a sketch - you press the upload button.  There is no typing (other than of course writing the sketch in the first place) involved in uploading a sketch.

Or are you not trying to upload a sketch?  Are you even programming an Arduino?
37  Using Arduino / Programming Questions / Re: reading CD4021BE shift in register on: June 09, 2014, 04:09:35 pm
your loads of help!
And so are you.  We can't help you unless you help us.  Try posting ALL your code, then we can look at the code and tell you why it isn't working and help you get it working right.

If you need spoon feeding, I'll give you a clue.  Here's the CORRECT binary translations:
Code:
00000001 = 1
00000010 = 2
00000100 = 4
00001000 = 8
00010000 = 16
00100000 = 32
01000000 = 64
10000000 = 128
38  Using Arduino / Programming Questions / Re: reading CD4021BE shift in register on: June 09, 2014, 03:25:17 pm
facetious much!!!!

ive just told you that

1 = 00000001
2 = 00000010
4 = 00000100
16 = 00001000
32 = 00010000
64 = 00100000
128 = 01000000
255 = 10000000

so how do i manipulate what data the shift register is sending in the code
No, those numbers are wrong.  Very wrong.
39  Using Arduino / Programming Questions / Re: reading CD4021BE shift in register on: June 09, 2014, 02:39:23 pm
Ok, then, here's a snippet of an answer.  A URL.  I won't tell you how to interpret it, but it's there for "ease of use"...

http://en.wikipedia.org/wiki/Binary_number
40  Using Arduino / Programming Questions / Re: Stuck in a print loop and can't unplug because it starts printing as soon as I on: June 09, 2014, 02:37:47 pm
You upload new code through the USB, just as normal.  Just because the Arduino is sending data doesn't stop you uploading a new sketch.  I think that has already been said before.

Try it - upload the "Blink" demo sketch.  You'll soon see it'll upload, and lo, the serial data will stop as well.
41  Using Arduino / Programming Questions / Re: reading CD4021BE shift in register on: June 09, 2014, 02:14:48 pm
I'm not surprised it doesn't work, it doesn't even compile.

And an 8 bit value can never be 256.
42  Using Arduino / Programming Questions / Re: Using SD card with default example code on: June 09, 2014, 01:55:10 pm
And are you following the instructions on the Adafruit website?

https://learn.adafruit.com/adafruit-data-logger-shield/using-the-real-time-clock-1 (they messed the URL name up there methinks).

That code uses chip select pin 4 - the Adafruit site (if you'd bothered to read it) says to use pin 10.
43  Using Arduino / Programming Questions / Re: Stuck in a print loop and can't unplug because it starts printing as soon as I on: June 09, 2014, 01:51:06 pm
I'm sorry, you're not making much sense to us.

You can't "modify" a running program, you can only upload a new program.

If you have lost or messed up your existing source code then that's too bad - you'll have to go back to square one and write your source code again from scratch.

Either that or just don't plug the USB in or open the serial port on the PC, so the serial data gets ignored?
44  Using Arduino / Programming Questions / Re: slash character in char array on: June 09, 2014, 12:51:35 pm
Except you still have no terminating character (line feed isn't end of string - character 0 is):
Code:
char mystring[4]={92,'r','\n', 0};
45  Using Arduino / Programming Questions / Re: reading CD4021BE shift in register on: June 09, 2014, 12:39:41 pm
Yes.
Pages: 1 2 [3] 4 5 ... 278