Show Posts
Pages: 1 2 [3] 4 5 ... 114
31  Using Arduino / Project Guidance / Re: Converting an organ to midi on: September 08, 2014, 10:20:20 am
You might find some info here: http://forum.hauptwerk.com/index.php

Pete
32  Using Arduino / Programming Questions / Re: Serial read pauses program on: September 07, 2014, 06:04:13 pm
The problem is this:
Code:
      byte size = Serial.readBytes(input, INPUT_SIZE);
You are asking readBytes to read 30 characters, which it will try to do. If it doesn't read 30 chars it will timeout after one second because you didn't tell it to do anything different.

If the data being sent end with a linefeed, you would be better off using:
Code:
      byte size = Serial.readBytesUntil(,'\n',input, INPUT_SIZE);
but you must make sure that the line is no more than 30 characters long including the linefeed.

Pete
33  Using Arduino / Programming Questions / Re: Serial.print Output changes the content of an array on: September 06, 2014, 05:13:02 pm
The getMatrixByMode function is returning a pointer to myArray[] which only exists within the getMatrixByMode function. The array needs to be global or at least scoped such that the calling function(s) still sees it.

Pete
34  Using Arduino / Programming Questions / Re: arduino 1.5.7 error java.lang.StackOverflowError at java.util.regex.Pattern$Loo on: September 05, 2014, 05:10:51 pm
I think another thing that can cause it is an unterminated comment
/*

Pete
35  Topics / Science and Measurement / Re: Arduino Timing Conflicts on: September 04, 2014, 10:29:54 pm
Quote
So, to sum this up: there are no problems when t-t' is small, only when t or t' is small.
Yes.

What is it you are trying to solve?

Pete
36  Topics / Science and Measurement / Re: Arduino Timing Conflicts on: September 04, 2014, 06:43:51 pm
No. If t=100 and t'=200 then you will be generating up to 6 characters every 200 microseconds or so depending upon how long the analogRead takes. But if the baudrate is 9600, it will take on the order of 6ms to actually transmit the characters. The buffer is going to fill up and then you'll lose characters.

Pete
37  Using Arduino / Installation & Troubleshooting / Re: Arduino auto restarts itself! on: September 04, 2014, 05:35:53 pm
@filippo94:
I think it would help a lot if you describe exactly what you mean by "autoreboot itself" and what you observe happening at this point.

Pete
38  Using Arduino / Installation & Troubleshooting / Re: Arduino auto restarts itself! on: September 04, 2014, 12:43:36 pm
add
delay(5000);
at the end of the loop() function.
It probably won't fix things altogether but you are reading and displaying the results too fast. Then, show us the output from the serial monitor for the first minute or so. (in code tags - not quote tags)

Pete
39  Using Arduino / Interfacing w/ Software on the Computer / Re: Serial Monitor affected by Serial.Read? on: September 04, 2014, 10:08:33 am
If there's no serial input available you process it as if there was. Try this:
Code:
 if(Serial.available())
   { // If data is available to read,
     val = Serial.read(); // read it and store it in val  
     a++;
      Serial.print("a = ");
      Serial.println(a);
    }

Pete
40  Using Arduino / Microcontrollers / Re: IC PROGRAMMING on: September 03, 2014, 09:07:23 pm
"one time only" and "EEPROM" don't really go together. If it is electrically erasable then it isn't one time only. However, IIRC, early EEPROMs were still referred to as one-time-only because they needed a separate 12V supply to rewrite them which required removing them from the production circuit (usually 5V only) and putting them in a programmer. [edit] Also IIRC, reprogramming them required hooking them up to a PC - usually through the parallel port.

Pete
41  Using Arduino / Microcontrollers / Re: IC PROGRAMMING on: September 03, 2014, 07:39:31 pm
The chip is rewritable but only in the presence of a a programming voltage on the VPP pin while the PGM pin is held low. The programming voltage might be 12V whereas the chip might be readable with 5V. It would have helped if you had identified the chip.

Pete
42  Using Arduino / Project Guidance / Re: Find nearest multiple of 8 from a variable? on: September 02, 2014, 04:25:35 pm
Heh - I'm just downing a cup of tea and a chocolate bar.
Yup - AWOL's solution is definitely the way to it.

Pete
43  Using Arduino / Project Guidance / Re: Find nearest multiple of 8 from a variable? on: September 02, 2014, 02:33:15 pm
Quote
Code:
x = (x + 7) & ~7;
x = (x + 7) / 8;

do exactly the same thing

No, they don't.
The first one is correct (for positive integers). The second one isn't even close.

Pete
44  Using Arduino / Programming Questions / Re: analogWrite > 255 by accident on: September 02, 2014, 10:52:37 am
It uses the low order 8 bits of the value. e.g. if you write a value of 257 it will have the same effect as writing 1.

Pete
45  Community / Website and Forum / Re: Forum no longer reloads automatically on: September 01, 2014, 10:40:36 pm
It has just started doing it again - 0337GMT 2nd Sept.

Pete
Pages: 1 2 [3] 4 5 ... 114