Show Posts
Pages: [1] 2 3 ... 8
1  Using Arduino / Microcontrollers / Re: Arduino-tiny UserTimer example on: April 27, 2013, 07:51:33 am
Hi guys, just wanted to say thanks for the simple example (and for the veneer in the first place Coding Badly!)

I am working on getting the correct values for an 8MHz clock speed so trying to learn as I go!

Cheers.
2  Forum 2005-2010 (read only) / Syntax & Programs / Re: A quick PulseIn question on: January 11, 2010, 04:54:30 am
Thanks TBAr, that's kind of what I thought from what I read in the Reference section.

Although it's not that important in my project if I miss 2/3, it's definately worth noting for any future projects!

I will definately have a look at the other thread in case I can use that instead.

Easty.
3  Forum 2005-2010 (read only) / Syntax & Programs / Re: A quick PulseIn question on: January 10, 2010, 05:47:01 pm
Thanks Lefty.
4  Forum 2005-2010 (read only) / Syntax & Programs / A quick PulseIn question on: January 10, 2010, 04:54:06 pm
I haven't got my setup, well, set up yet so I can't test this but can I use PulseIn twice in a row to calculate duty cycle?

highPulse = pulseIn(InputPin, HIGH);
lowPulse  = pulseIn(InputPin, LOW);
dutyCycle = highPulse/lowPulse;

The pulses are from a car engine so will not vary wildly between pulses so "missing" one won't cause too much of an issue.

Thanks in advance, Easty.
5  Forum 2005-2010 (read only) / Syntax & Programs / Re: Advice on creating a lookup table. on: May 05, 2009, 04:13:48 am
Sorry for the delay, thanks for the advice, it works like a charm!
6  Forum 2005-2010 (read only) / Syntax & Programs / Advice on creating a lookup table. on: April 30, 2009, 02:41:38 pm
I wonder if someone can point me in the right direction with a bit of code I'm about to start.

I'm looking at creating a lookup table to return a string depending on the value of 2 ranges of values.

This is a simplifed version of the table:

Code:
                 <-1.33                   -1.33 to -0.33             0 and above
>1022.69             Cloudy, Warmer             Fair                   Continued fair
1009.14 to 1022.69       Precipitation likely       Little change             No change       
<1009.14                  Storm                   Rain                   Clearing, cooler

I imagine an 2D array would be able to be used, but I was wondering if there is a "good" way of going about it!

Thanks in advance, Easty
7  Forum 2005-2010 (read only) / Syntax & Programs / Re: 4 variables, 1 outcome on: January 07, 2009, 03:07:52 pm
I like it!

Thanks!
8  Forum 2005-2010 (read only) / Syntax & Programs / 4 variables, 1 outcome on: January 07, 2009, 12:19:17 pm
Hi everyone,

I'm looking for suggestions about how best to do the following in a neat and tidy way!

I have 4 variables that can be 0,  2, 3 or 5.
There are 16 combinations that I'm interested in.

What I'd like to be able to do is call a function with the with variables and for it to return the corresponding combination number.

Clear as mud? I thought so!  ;D

I can do it using 16 if statements but someone must have a neater way of doing it!

Thanks, Easty.
9  Forum 2005-2010 (read only) / Syntax & Programs / error: ‘map’ was not declared in this scope on: August 06, 2008, 02:55:10 pm
Hi everyone, hope you can help.

I'm trying to use the map function in the following code:

Code:
int val1;

void setup() {
  Serial.begin(9600);
}

void loop() {
  val1 = analogRead(1);
  val1 = map(val1, 0, 1023, 0, 255);
  Serial.println(val1);
  delay(200);
}

But when compiling I get this error:

Code:
In function 'void loop()':
error: 'map' was not declared in this scope

I'm stumped.

Thanks in advance, Easty.
10  Forum 2005-2010 (read only) / Interfacing / Re: Reading serial bytes in the serial monitor on: October 14, 2008, 04:35:59 pm
Thanks guys, you are quick!

The problem is I was trying to read the output of the serial comms whilst connected to the other equipment as well (it's an iPod which requires BYTEs to be sent)
11  Forum 2005-2010 (read only) / Interfacing / Reading serial bytes in the serial monitor on: October 14, 2008, 04:05:15 pm
Probably a stupid question so apologies in advance...

I'm writing bytes using the serial.print command:

Serial.print(bytes, BYTE);

Whilst trying to debug my program with the connections in place I'm not able to see the output in human readable form (a load of boxes and symbols).

I'm not sure if there's anything I can do to check the output, any assistance would be appreciated!

Thanks.
12  Forum 2005-2010 (read only) / Development / Re: Programmer2 Issues on: November 23, 2008, 08:20:41 am
Thanks dcb, I'll take a look at the link.

I just tried the *p command and I receive a ProbeFailed response.

Cheers, Easty.
13  Forum 2005-2010 (read only) / Development / Re: Programmer2 Issues on: November 22, 2008, 04:35:50 pm
Thanks dcb, I'm away from the Arduino today, I'll check tomorrow.
14  Forum 2005-2010 (read only) / Development / Programmer2 Issues on: November 21, 2008, 06:27:30 pm
Hi everyone,

I'm playing with burning bootloaders into a virgin chip I have and have  followed the Programmer2 instructions here:
http://www.arduino.cc/playground/Code/Programmer2

But nothing appears to be happening when I power the "source" board.

If I try to use the *A command I get a "Unknown device type. Failed." message back.

I'm trying to use a 4MHz crystal on the "target" chip, is that my problem?

Thanks in advance, Easty.

15  Forum 2005-2010 (read only) / Troubleshooting / Re: LED Resistor values - Please check my calcs... on: December 16, 2008, 04:29:12 pm
Thanks mem, I'll give it a go and see if anything catches fire! ;0)

(Maybe I'll start a little higher)
Pages: [1] 2 3 ... 8