Show Posts
|
|
Pages: [1] 2 3 ... 5
|
|
1
|
Using Arduino / Sensors / Re: new thermocouple interface: MAX31855
|
on: August 11, 2011, 08:15:04 pm
|
|
Andy, Thanks for the library. Worked like a charm. I has one in the works, but it was buggy and had issues with the spi timing, yours works great. I send you a pull request on github with a example I added to the lib.
|
|
|
|
|
3
|
Forum 2005-2010 (read only) / Syntax & Programs / Problems writing library
|
on: January 18, 2009, 01:35:58 pm
|
This is my first library, but having a few problems... I cannot seem to get my example to compile. The code is going to be posted here http://code.google.com/p/max6675-arduino-library/ and playground http://www.arduino.cc/playground/Main/MAX6675Library I am getting the following error: In file included from /Applications/arduino-0012/hardware/cores/arduino/WProgram.h:4,
/Applications/arduino-0012/hardware/tools/avr/bin/../lib/gcc/avr/4.3.0/../../../../avr/include/stdlib.h:80: error: expected unqualified-id before 'int'
/Applications/arduino-0012/hardware/tools/avr/bin/../lib/gcc/avr/4.3.0/../../../../avr/include/stdlib.h:80: error: expected `)' before 'int'
/Applications/arduino-0012/hardware/tools/avr/bin/../lib/gcc/avr/4.3.0/../../../../avr/include/stdlib.h:80: error: expected `)' before 'int'
/Applications/arduino-0012/hardware/tools/avr/bin/../lib/gcc/avr/4.3.0/../../../../avr/include/stdlib.h:111: error: expected unqualified-id before 'int'
/Applications/arduino-0012/hardware/tools/avr/bin/../lib/gcc/avr/4.3.0/../../../../avr/include/stdlib.h:111: error: expected `)' before 'int'
/Applications/arduino-0012/hardware/tools/avr/bin/../lib/gcc/avr/4.3.0/../../../../avr/include/stdlib.h:111: error: expected `)' before 'int'
/Applications/arduino-0012/hardware/tools/avr/bin/../lib/gcc/avr/4.3.0/../../../../avr/include/stdlib.h:144: error: expected identifier before '(' token
/Applications/arduino-0012/hardware/tools/avr/bin/../lib/gcc/avr/4.3.0/../../../../avr/include/stdlib.h:144: error: expected `)' before '(' token
/Applications/arduino-0012/hardware/tools/avr/bin/../lib/gcc/avr/4.3.0/../../../../avr/include/stdlib.h:144: error: expected ',' or '...' before '(' token
/Applications/arduino-0012/hardware/tools/avr/bin/../lib/gcc/avr/4.3.0/../../../../avr/include/stdlib.h:144: error: expected initializer before ')' token
/Applications/arduino-0012/hardware/tools/avr/bin/../lib/gcc/avr/4.3.0/../../../../avr/include/stdlib.h:176: error: '__compar_fn_t' has not been declared
In file included from /Applications/arduino-0012/hardware/cores/arduino/WProgram.h:6,
Any ideas?
|
|
|
|
|
6
|
Forum 2005-2010 (read only) / Syntax & Programs / Background running program
|
on: December 30, 2008, 09:59:49 pm
|
|
I was wondering if it is possible to run a function in parallel with the main loop. What I am trying to do is run an interrupt with a delay to turn on and off a output but at the same time I want to keep the main program running. I am not to worried about the main program but making sure the interupt function works ( runs at 120hz).
Thanks for the help!
|
|
|
|
|
7
|
Forum 2005-2010 (read only) / Syntax & Programs / Re: String Comparison
|
on: December 03, 2008, 09:02:40 am
|
|
Thanks, I can usually pick this stuff up fairly quick.
I see what you mean about the declaration... I will most likely use updatestatus() in some other sub functions and call it directly.
I forgot you can just use " ", in strcat. Its things like that that will help me keep program size down.
Thanks for your help.
|
|
|
|
|
8
|
Forum 2005-2010 (read only) / Syntax & Programs / Re: String Comparison
|
on: December 02, 2008, 11:22:42 pm
|
halley, thanks for the function advice. I have never used C before (used to PHP) but the knowing I can use the standard string functions made a huge difference. Plus I was also able to add code to center the text (the LCD is 20 wide)... // Main Program char status[20]; // create buffer: status char currentstatus[20]; // create buffer: currentstatus
/* Update the Status on the LCD */ char* status = "Hello World."; updatestatus(status); /* updatestatus(char* status) This function checks to see if the status passed is the currently registered status. If it is not it sets it to the currently registered status, evaluates the length, computes the number of spaces to add to the front of the status to center it, and finally prints the formatted status to the top line of the LCD. */
void updatestatus(char* status) { // Check and see if the currently display status is the active status if(0 != strcmp(currentstatus, status)) { strcpy(currentstatus,status); // copy status to currentstatus to show it has been read.
int statuslen = strlen(status); // get the length of the status string int spaces = ((20 - statuslen) / 2); // calculate the number of spaces to place in front to center the text on the LCD char statusf[20]; // create a buffer for formatted status: statusf char* space = " "; // create a space for(int i=0; i<spaces; i++) { // for each space that needs to be generated strcat(statusf,space); // add space to the formatted status using strcat() } strcat(statusf,status); // add the status message to the formatted status with leading spaces
// Update the LCD top line lcd.print("?a"); // set the cursor to home lcd.print("?l"); // clear the line lcd.print(statusf); // print the formatted status } }
Thanks alot for your help. I am still very new to this, but you are all very helpful. This starts to get easy very quickly. I think is my lack of C knowledge holding me back.
|
|
|
|
|
9
|
Forum 2005-2010 (read only) / Syntax & Programs / String Comparison
|
on: December 02, 2008, 09:21:42 pm
|
So I am trying to create a function to update the status text on my LCD, and store the current value it has written so it only updates on a change of the status, but for some reason "currentstatus" is always blank... here is the code. char status[40]; char currentstatus[40];
/* Update the Status on the LCD */ char* status = "Hello..."; Serial.println(status); Serial.println(currentstatus); if(currentstatus != status) { updatestatus(status); char* currentstatus = status; } Any ideas on where I am going wrong??
|
|
|
|
|
12
|
Forum 2005-2010 (read only) / Development / Re: MAX6675 Interface Boards
|
on: July 21, 2009, 03:14:44 pm
|
|
Temperature measurement...
Using thermocouples is a very standard way of measuring temperatures. They also measure a much wider range of temps than most silicon based sensors. This chip can measure 0 to 1024 deg C with a K-Type Thermocouple attached.
Common uses could be oven control, temp sensing, fluid temperature, etc. I have one of the quad boards with 4 thermocouples hooked up to my grill to see my grill temp and I use a few probes to check meat temperature as well.
|
|
|
|
|
15
|
Forum 2005-2010 (read only) / Interfacing / Re: AC Light Dimming
|
on: July 20, 2009, 08:46:08 pm
|
Glad to see there is so much progress on this topic! This is getting far more detailed than I ever expected. Awesome! Sorry I have not been around too much. My "real" job has been keeping me away from fun projects like this. However, I have been having some more time lately to get back into things. I should be posting in the next few days some more info on the final version of the "Darwin Shield"  4 AC I/O for the Arduino. I am trying to work out the best way of enclosing the whole thing and connectors for each output. Let me know if you have any input.
|
|
|
|
|