Show Posts
Pages: 1 ... 125 126 [127] 128 129 ... 353
1891  Using Arduino / Programming Questions / Re: Storing a previous value/creating an array on: July 15, 2013, 05:50:04 pm
Time to hit the tutorials. Arrays are fundamental.

http://arduino.cc/en/Tutorial/HomePage

http://arduino.cc/en/Tutorial/Array

Quote
Examples > Control Structures

Arrays

This variation on the For Loop example shows how to use an array. An array is a variable with multiple parts. If you think of a variable as a cup that holds values, you might think of an array as an ice cube tray. It's like a series of linked cups, all of which can hold the same maximum value.

The For Loop example shows you how to light up a series of LEDs attached to pins 2 through 7 of the Arduino, with certain limitations (the pins have to be numbered contiguously, and the LEDs have to be turned on in sequence).

If you have to ask what a For Loop is then look on the first link, the Tutorials main page, for the For Loop example and learn from that. If some part of that is outside of your knowing then find the example on that.

I don't want to be a pain but there's books and sites that explain all these things clearly without someone having to write the same things perhaps not as completely or clearly here.
Either way, you have reading and practice to do, there is no USB-to-mind download.

If it's any consolation, everyone who knows the stuff had to go through a learning process that kind of never ends. If you think it's hard now, it was harder before the internet brought everything right to you. Back then I found that a nice Sam's or Que book let me learn faster than any classes.
1892  Using Arduino / Programming Questions / Re: Running independent from the computer on: July 15, 2013, 05:27:22 pm
Try connecting more 9V batteries in parallel, NOT series. You'll get more current.
1893  Community / Bar Sport / Re: Fake Arduino. on: July 15, 2013, 05:24:03 pm
How about finding out what Arduino wants for you to be a supporter? It may work out.
1894  Community / Bar Sport / Re: Keep weapons off Arduino forum and website on: July 15, 2013, 05:17:51 pm
There only has to be enough doubt to get "not guilty".

The trial can be a complete joke from both sides. Remember OJ and the custom fit gloves not fitting over hands with rubber gloves on as if the rubber gloves have zero thickness only matched by police shenanigans? Or the whole Terry Schiavo circus with Dr. Frist giving a exam by video? And let's not go into the Rodney King trial.....

Yet "we have the best system in the world", uh huh.

I look at Zimmerman, I see a liar. That doesn't mean he's guilty though. Martin should have ran his butt off around as many corners as he could get.

1895  Community / Bar Sport / Re: Keep weapons off Arduino forum and website on: July 15, 2013, 02:42:29 am
I'm glad you could do that in the UK.
Perhaps your Chavs with whatever Chavs use is not as big a problem as I imagine nor a growing one.

Here is more like Northern Ireland only many times the size of the EU with 6 factions instead of 2, at least 2 of those willing (they've done it) to supply guns and ammo to the reasons we need hard liners.
1896  Using Arduino / Programming Questions / Re: Losing data when reading from the Serial port on: July 15, 2013, 02:29:24 am
Code:
boolean serialRead()
{
  char c;
 
  while(Serial.available())
  {
    c = Serial.read();
    bytesRead++;
    switch(c)
    {
      case '\r':
      case '\n':
        // Discard special characters
        break;
      case COMMAND_SUFFIX:
      // End-of-command received
        serialBufferOffset = 0;
        return true;
        break;
      default:
        if(serialBufferOffset < SERIAL_BUFFER_SIZE)
          serialBuffer[serialBufferOffset++] = c;
        serialBuffer[serialBufferOffset] = '\0';
        break;
    }
  }
 
  return false;
}


This still has the same problem I tried to point out last time. Arduino running at 16 MHz can easily outrun incoming serial bytes. Just because none are available doesn't mean you have reached end of line.

If I might suggest?

Use 2 states in loop() so that:

if ( state == 0 ) then if serial.available you read the character and either add it to the buffer or at line end you change the state to 1. This would be a good place to filter out bad characters as well, but that's as far as I'll go with that.

if ( state == 1 ) then you do your work on the line of data and when that's done, change state to 0.

Later on you might try a better trick. Using states you can keep track of what each incoming byte -means- and interpret your data on the fly. I have a sketch that reads a 1 letter plus digit format as command code + data that way, the 'buffer' is 1 character and an int to accumulate digits into a value.
With the buffer and interpret method you start making sense of the data after gathering it. With the other way, interpretation is done when end of line (or timeout if you want to be real good) is found, it is done when the buffer method is getting started.
1897  Community / Bar Sport / Re: Keep weapons off Arduino forum and website on: July 15, 2013, 01:56:16 am
FWIW I find that people who did not have guns as a serious part of growing up take what I think are extreme views based on impressions and ignorance. That is what I think a lengthy course can correct but not in everyone so again IMO part of such is course is to spot the twits and loonies and flunk them out. But then here is anything-for-a-buck-land I might as well go looking for a genie bottle as expect 100% success.

As for the people who seem to think that they can vote guns away like there's some magic fairy wand to disarm everyone; sorry sweetheart but all you will do is disarm some people and leave them open to not just gun treats/attacks but knives, bats, hands and feet. You won't end killing, you'll just change how it's done sometimes. Fairy land is for bedtime stories and dreams, like the kind Karl Marx sold.

1898  Community / Bar Sport / Re: My new arduino TShirt on: July 14, 2013, 03:24:58 pm
How about a shirt showing a DIY capacitive touch sensor and schematic to put a real sensor behind the one on the shirt and an AVR and some leds or a speaker for feedback? Then you can get people to touch places.....

I'm sure there would be other interesting schematics and apps. Arduino isn't just about development boards, it's what you can make and program with them.

1899  Community / Bar Sport / Re: Real development tools on: July 14, 2013, 03:18:42 pm
Code Blocks (free and full) has an Arduino add-on or version but I've not used it mainly because I've not needed it. The IDE is enough for the little things I do.

 
1900  Community / Bar Sport / Re: Keep weapons off Arduino forum and website on: July 14, 2013, 03:12:45 pm
That's why I am in favor of making people attend the kinds of courses I did before they are allowed to carry or use guns. That guy has or had what I call a toy gun attitude. Most TV and movie gun use is the very same. The example I used to point to was the A-Team show: a million bullets and no one gets hurt. Effing six-year-olds.

Stopping the radio would only take a shot through the car battery and -that- is enough to land the shooter in jail because that is over the top.

Well anyway, there's another wedding ruined by stupidity.

We have a couple of problems behind the violence. The biggest is the conservative hate tv and radio constantly feeding end of the world messages and kill them all solutions.
1901  Community / Bar Sport / Re: 3D gun printing good or bad on: July 14, 2013, 06:20:17 am
No. I don't worry about used-car-priced plastic guns when there's better, cheaper and better & cheaper guns on the streets around here (and GOOD LUCK taking those away!).

I've got a crossbow pistol that's about as effective. I paid $10 for it, new. It's quieter than the gun.


1902  Community / Bar Sport / Re: 3D gun printing good or bad on: July 14, 2013, 03:42:36 am
Those _are_ some of _the_ major group of politicians that keep any form of gun control from happening here.

I am VERY in favor of regulation, more than just background checks. I am very much against immediate gun show sales.

1903  Community / Bar Sport / Re: My new arduino TShirt on: July 14, 2013, 03:38:53 am
Concern... I was thinking sales incentive. Those who bought knock-off Arduinos and then found out can go a ways to make up for it by buying "accessories" that do support the movement.

But you are not selling the shirts. So what was that site, or should I say whom?

Also, I remember seeing shirts in the 80's with motherboard and chip blueprints. Those were cool. There's all kinds of schematics that say Geek far more than a picture of an UNO. ;^)
 
1904  Using Arduino / Project Guidance / Re: Car-powered project on: July 14, 2013, 03:28:53 am
Voltage regulator.  Like car voltage 12 to 14 volts regulated down to 9 volts.

1905  Community / Bar Sport / Re: 3D gun printing good or bad on: July 13, 2013, 10:56:31 pm
Arduino is okay since it doesn't use atheistic evolution and isn't part of the global warming conspiracy hoax.

Pages: 1 ... 125 126 [127] 128 129 ... 353