Show Posts
|
|
Pages: 1 2 [3] 4 5 ... 28
|
|
31
|
Forum 2005-2010 (read only) / Syntax & Programs / Re: Error with mathematical calculation
|
on: November 12, 2006, 11:06:50 am
|
You are correct about that, I changed that after posting. The Arduino environment does support this type of code: float var = 0; But, it consumes a lot of extra memory... I am running already into the limits of the memory of the Atmega8. Would it be really hard to use the Atmega168 on the Arduino board (not the mini)?
|
|
|
|
|
32
|
Forum 2005-2010 (read only) / Syntax & Programs / Error with mathematical calculation
|
on: November 11, 2006, 07:42:54 am
|
I have to do this calculation which I do with the following source: int analogPin = 0; // Pressure sensor connected to analog pin 0 long val = 0; // variable to store the read value
void setup() { Serial.begin(9600); // opens serial port, sets data rate to 9600 bps }
void loop() {
val = analogRead(analogPin); // read the input pin (getting value of around 840-860) val = ( 1 - ( val/ 1013.25 ) ^ 0.19) ) / 22.558; Serial.print("Value: "); Serial.println(val); delay(1000);
}
This line gives an error: val = ( 1 - ( val/ 1013.25 ) ^ 0.19) ) / 22.558; The error is: In function 'void loop()': error: invalid operands of types 'double' and 'double' to binary 'operator^ I hope someone can help to solve this. I am totally new to the Arduino. Thank you in advance!
|
|
|
|
|
35
|
Forum 2005-2010 (read only) / Interfacing / Re: Interfacing with max187
|
on: December 07, 2006, 07:47:45 am
|
Thanks Daniel, That is a start... I have taken your note in the thread about SPI problems! - use one (digital) pin to select the chip, This seems to be the easy part - use another to sense when the A/D sampling is finished, Any hints on how to do that? Edit: I mean, how to 'sense when the A/D sampling is finished'. - use a third pin to supply a clock signal to "shift out" the sampling result data, and I need also a hint for this. I hope I won't regret starting with this.... lol
|
|
|
|
|
36
|
Forum 2005-2010 (read only) / Interfacing / Interfacing with max187
|
on: December 07, 2006, 05:16:15 am
|
|
I am working on a project that uses a pressure sensor. So far, I have used the pressure sensor (Motorola/Freescale mpx4115ap) connected to an analog port on the Arduino NG. This worked ok, but since the 10-bit adc, I decided to start using an MAX187 12-bit adc to get better resolution. For an electronics Noob, this is quite an adventure.
I need some help to get started. I take it that I need to use a digital input and can use digitalread() to gather data. So far, I read that digitalread() just returns HIGH or LOW. When I used the pressure sensor with on an analog port, I just got a number that I could work with. Now it seems that I have to take some HIGH and LOW values to come to a number.
I don't see how to do this. Anyone who can help?
Thanks in advance!
Jan-Dirk
|
|
|
|
|
38
|
Forum 2005-2010 (read only) / Development / Re: AVRProjectIDE - Editor for AVR/Arduino Projects
|
on: October 24, 2009, 03:19:24 pm
|
|
Very nice you are working on this!
I am experiencing some problems though with code that compiles ok in the Arduino IDE, but not with yours. For example, I am using NewSoftSerial and SoftwareServo in my PDE. For both libraries I have an include. For example, I get messages: 'NewSoftSerial' does not name a type, 'Servo1' was not declared in this scope. Maybe it is a setting I am not aware of, but like I said, I don't get these messages in the Arduino IDE.
I also have a couple of suggestions: - For example, Ctrl-G, to Go To a line (like in VS editor) - Automatic save of (changed) files for backup every 5 minutes or so (I mention this because I let my computer on last night, for some reason the computer shut down and I lost my changes)
Looking forward to new version!
|
|
|
|
|
39
|
Forum 2005-2010 (read only) / Development / Re: Dallas Temperature Control Library released ;)
|
on: January 05, 2010, 07:56:08 am
|
I want to convert the sensor address to a string, but I have hard time getting it to work. This is what I tried: void DeviceAddressString(DeviceAddress deviceAddress) { char *deviceAddressString=""; char *tempAddr; strcpy(deviceAddressString, ""); for (uint8_t i = 0; i < 8; i++) { itoa(*deviceAddress[i], tempAddr, 10); strcat(deviceAddressString, tempAddr); } }
A call to this function should fill deviceAddressString with the value of the device address. DeviceAddressString(insideThermometer);
Help/suggestions are appreciated.
|
|
|
|
|
41
|
Forum 2005-2010 (read only) / Development / Re: RF Modules/VirtualWireLibrary/DallasOneWireLibrary
|
on: November 23, 2009, 04:20:53 am
|
Thanks again for your reply. A range of 2km is very nice. With LOS it will be even better probably. Last week I have ordered 1 tx and 1 rx from Sparkfun. These are pretty similar to what you have, but lower range probably. For the DR3100 I linked to earlier, I have an amplifier that I will try with the transceiver. Somewhere in this thread I read that you were also using a DR3100. Sorry for the confusion!
|
|
|
|
|