Show Posts
Pages: [1] 2 3 ... 148
1  Using Arduino / Programming Questions / Re: Synchronizing Interrupts and void loop ?? on: Today at 01:35:31 pm
Stop using noInterrupts() all over the place, the one at the start of setup() is not required. And so are the ones in each of the interrupt handlers!

Interrupts are disabled by the CPU when you enter the interrupt handler they are automatically turned on again at the end of the handler.

Turning off interrupts stops micros(),mills() and there related functions from working it also makes a mess of serial.

There is no need to turn off interrupts when reading/modifying a boolean!

Mark
2  Using Arduino / Programming Questions / Re: Arduino in build Led on: Today at 08:18:53 am
Even if that code where in a loop you would still never see it blink!. You can see individual blinks once the rate is over about 10Hz.

Mark
3  Using Arduino / Programming Questions / Re: Arduino in build Led on: Today at 04:42:48 am
Where is the rest of the program, POST IT!

Mark
4  Using Arduino / Programming Questions / Re: arduino serial erratic behaviour missing characters on: July 22, 2014, 06:22:52 am
There is nothing wrong with Serial. The problem is in your code and the way you are trying to read the data. Get rid of the use of ParseInt() and do the job properly.

Mark
5  Using Arduino / Programming Questions / Re: Reading the value of a sensor every X millis (best practise?) on: July 22, 2014, 06:14:58 am
Blink without does NOT there to show how to blink a LED its there to show you how to do something every x mill seconds.!

Mark
6  Using Arduino / Programming Questions / Re: Reading the value of a sensor every X millis (best practise?) on: July 22, 2014, 05:44:01 am
Your missing the point. you use "blink without" to decide when to print the valuse and do what ever you want with the rest of the time.

Mark
7  Using Arduino / Programming Questions / Re: Unlogical but simple errors coming from P5 to arduino on: July 21, 2014, 02:45:27 pm
Posting your code would help. Run the auto formatter (on the tool bar) and you will SEE your errors.

Mark
8  Using Arduino / Project Guidance / Re: Estimating velocity and position on: July 21, 2014, 04:50:30 am
Physics is case sensitive to. If this is what I think it is (N-body problem solved by Euler's method or one of its derivatives)  then it's not g.

Mark
9  Using Arduino / Project Guidance / Re: Estimating velocity and position on: July 21, 2014, 03:42:31 am
Look it up where ever you found those equations, and no T is not 9.8!

Mark
10  Using Arduino / Programming Questions / Re: PC Application for controlling Arduino on: July 18, 2014, 05:54:40 pm
If your writing software to run on the Arduino you are learning a programming language- get on with it!

Mark
11  Using Arduino / Programming Questions / Re: Using packed binary data from pc serial on: July 18, 2014, 05:06:10 pm
Quote
As long as your COM channel never has errors you should be good to go without start or stop data.

How do you find the start of the first message?

OK back to the problem first,

1. What on the PC is sending the data,

2. What is the protocol? each packet consists of a <header><data><tail> your telling us about the data but we (and you) need to know the rest. And you are not using '\n'!.

After that we need to know what tpe of Arduino you have and how you intend to debug this. If your using the com port for data you can't use it for debuging! Does your Arduino have more than one com port?

Mark
12  Using Arduino / Programming Questions / Re: Using packed binary data from pc serial on: July 18, 2014, 02:32:22 pm
Now you need to find the start and end of packet markers otherwise you wont get this to go in years let alone days.

Mark
13  Using Arduino / Programming Questions / Re: Using packed binary data from pc serial on: July 18, 2014, 01:08:03 pm
Start by understanding that there is NO SUCH THING AS DECIMAL VALUE, or a hex value etc. Thats just how we write things down for our convenience !

The values of type and id should give you the size and meaning of the message.

Mark
14  Using Arduino / Programming Questions / Re: Does anyone know why serialEvent1 is does not function on ATMega32U4 devices on: July 17, 2014, 02:53:14 pm
So how does attachInterrupt() work?

Mark
15  Using Arduino / Programming Questions / Re: #define, int or const int on: July 16, 2014, 04:09:48 am
For pin number you should not use int as it wastes memory, use one of the byte sized types.

Mark
Pages: [1] 2 3 ... 148