Show Posts
Pages: 1 ... 100 101 [102] 103 104 ... 361
1516  Using Arduino / Programming Questions / Re: How to program an ATMEGA328 or ATMEGA328P on: December 23, 2013, 12:37:09 am

First time I saw this page.  AWESOME! We need a bow-down smiley!
1517  Using Arduino / Programming Questions / Re: what is wrong with my problem? on: December 21, 2013, 12:07:28 pm
Frack me, they indeed changed it just after i graduated. Bastards.  smiley-lol Nevertheless it looks awful, it's rarely used, and in my opinion looks too much like Visual Basic,

 smiley-grin smiley-grin smiley-grin smiley-grin smiley-grin smiley-grin smiley-grin smiley-grin smiley-grin smiley-grin smiley-grin smiley-grin smiley-cool smiley-cool smiley-cool smiley-cool smiley-cool smiley-cool smiley-cool smiley-cool smiley-cool smiley-cool smiley-cool

Or just about *any* BASIC that I remember, not just the borrow-from-C newcomer.

Oh BTW, VB was made to do whatever all M$ software was made to do: make money off other people's ideas.
1518  Using Arduino / Programming Questions / Re: Check Same Condition Twice to trigger event on: December 21, 2013, 12:01:03 pm
This is to help you get past this stage in your learning quicker and with less pain all around:

You could try

1) put this sketch aside for later since you don't know enough to attempt it.
2) learn more about programming until you know what you're doing enough to pick it back up.

Here is a page with a very good explanation of the same thing that BWD does. If you can't eat pork then the bacon is turkey bacon  smiley-lol which is tasty and allowed.
http://www.gammon.com.au/forum/?id=11411

BTW, if you think I'm rough or rude then wait till you get to know the compiler!
1519  Using Arduino / Programming Questions / Re: what is wrong with my problem? on: December 21, 2013, 02:46:40 am
Quote
And what did I win?
   smiley-mr-green smiley-mr-green

The comfort of being the biggest geek in the thread. Long live the geek!
1520  Using Arduino / Programming Questions / Re: Check Same Condition Twice to trigger event on: December 21, 2013, 02:39:32 am
As long as temperature is >= 30, currentTime is not updated which the label is misleading anyway but figure out what that does.but oh, wait, BWD is far simpler and apparently that is too much.

Make enough gut-feel hunch-based changes and in time your code might do what you think it should.
When you get tired of that, start working out the logic.
1521  Using Arduino / Programming Questions / Re: Check Same Condition Twice to trigger event on: December 17, 2013, 03:20:52 pm
Somebody still doesn't know how BWD works. Not. At. All.
1522  Using Arduino / Programming Questions / Re: Programming over ethernet. Is it possible ? on: December 17, 2013, 10:25:17 am
You can. Understatement: It will take a bit of doing on the PC.
You might want to get to know Arduino a bit better before undertaking remote programming one.
1523  Using Arduino / Programming Questions / Re: Check Same Condition Twice to trigger event on: December 17, 2013, 10:17:18 am
So many things wrong...

Code:
void loop()
{
 if (degreesC > 0);
 timer = millis(); //start timer

if (millis() - timer >= (10000UL * 60 * 20)){ //after 20 Min
 tempCheck = degreesC; //check temperature
}
if (tempCheck >= 0){
  //send SMS code here?
  }

Where is degreesC set?

An IF that goes nowhere followed by timer being updated to now.
Code:

if (degreesC > 0);
 timer = millis(); //start timer

Don't just look at the BlinkWithoutDelay sketch. Work with it. Play with it. Figure out what they got wrong and why it works anyway and when/how the gotcha happens, ie Know It.
1524  Using Arduino / Programming Questions / Re: Random State Machine on: December 17, 2013, 10:01:35 am
I am not convinced by the "floating analog input" theory of initialising the "random" number sequence.

An alternative suggestion,  is to measure the time in millis() between when the sketch starts,   and the first time you press the button.    Use that number to initialise the random number sequence.    Unless you are very predictable,   you are not going to make that first button press exactly the same number of milliseconds after the arduino reset very often.

Just take the lowest 8 or fewer bits of time. No one is that consistent. It's so easy to get past human capabilities with Arduino!
1525  Using Arduino / Programming Questions / Re: How to check if the Arduino Uno has a memory problem? on: December 17, 2013, 09:55:14 am
Code:
int freeRam () {
  extern int __heap_start, *__brkval;
  int v;
  return (int) &v - (__brkval == 0 ? (int) &__heap_start : (int) __brkval);
}

String objects use dynamic allocation. They can mess up your heap and waste bytes besides the overhead they use.
When you have 2k for heap and stack, using C++ String objects is like having truck races in a 2 acre field. You can but it's not going to be pretty.
1526  Using Arduino / Programming Questions / Re: LEDs and Pointers on: December 17, 2013, 09:45:21 am
This is a problem:
Code:
int *buttonState = LOW;    // variable for reading the pushbutton status
That declares a pointer to address zero. You need to declare a variable to point to, you're getting a pointer to something later on when you use &. What is needed here is:

I'm pretty sure that the compiler does allocate 2 bytes for that just because = LOW is there. Same way as
short *small_vals = { 9,8,7,6,5,4,3,2,1,0 }; // creates a filled array of 10 members pointed to by small_vals

int *buttonState;    // here's how to make a problem
*buttonState = LOW; // I wonder if RAM bytes 0 and 1 are important?
1527  Using Arduino / Audio / Re: Got a VLSI VS1000 Audio Module working with serial control. on: December 17, 2013, 09:27:43 am
There is much for you at the VLSI website. Their DSP's have MCU's built-in with program space and limited GPIO pins. There's a book on programming the 1053 there.

2 pins? Adafruit has a VS1053 + SD breakout module for $25. By default the control is SPI which is > 2 pins. Most VLSI modules I have seen use SPI.
1528  Using Arduino / Audio / Re: Got a VLSI VS1000 Audio Module working with serial control. on: December 17, 2013, 12:35:12 am
I sent data between 2 UNO's using software serial on both. Some characters corrupted. Yes, I tried more than once and did change jumpers. Soldered, it may be okay. 57600 worked solid as rock. End of story.

I used a MEGA to get the VS1000 playing right.
1529  Using Arduino / Programming Questions / Re: Multiple SPI on: December 15, 2013, 10:48:48 am
Is there a reason to not want to connect SCK, MISO, MOSI to all devices and just give each its own Slave Select?
The chip still just has 1 8-bit bus internally, and only runs 1 instruction at a time.


If you were reading one file and writing another 'at the same time' then having them on different cards on different SPI buses would save time since both would stay open, selected and positioned all the time. On one bus, you read then close the file, deselect the SD, select the other SD, initialize, open file, seek, write, close, deselect, etc. You do a lot again and again just getting to where the card on the dedicated bus only has to do once.
If you only append-write one file to a card, it will not get shotgunned.
Instead of sorting, write ordered-link files or better yet have a PC do that and use the links in the sketch.

But when I saw the 2560 having 4 UARTs capable of MSPIM in the datasheet, I thought network. I think that Grumpy Mike (or AWOL?) remembers the Transputer and the Occam language. IIRC in 1985 the nodes were 8 MHz Von Neumann computers with 4 high speed serial links each. Only thing is that AVR's are not Von Neumann, but Harvard architecture? However hard it's proving, there is some effort to bring Occam to AVR (328's). Occam would be a good path for interconnected 2560's? They could have 64k RAM using external RAM. They'd have an SPI bus channel each, for SD of course. But what to do with it? Blink leds?

Back in the later 80's I read of a Cal Tech machine made of 64 PC/XT mobos serial linked as a 6-dimension hypercube, 2^6=64. It had 1/10th the power of a CRAY but could do physics problems that formerly only CRAY-class computers could do.

I wonder how many 2560's it would take to match my SEMPRON 2600 and mobo?
1530  Community / Bar Sport / Re: Lawn Mower on: December 02, 2013, 11:09:53 pm
LOL! Makes me think of a POV display board!

Pages: 1 ... 100 101 [102] 103 104 ... 361