NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.
Support Forum » tempsensor fail: printf_P and fprintf_P don't output anything
October 23, 2010 by dthomas |
I have completed the tempsensor tutorial project. Everything seems to be working: I get temperature reads and all. Except for those parts of the program that use the streams, both Sample output:
This tells me, that the wiring is alright. It also tells me, that the I'm pretty new to hardware, but from my experience as a software developer I guess the problem might be in linking the
I'm running Mac OS X 10.4.11. Also, this might hint at the compiler I'm using (I'm pretty sure I just followed your guide)
Where should I start looking for the error? |
---|---|
October 23, 2010 by hevans (NerdKits Staff) |
Hi dthomas, Did you remember to run
on the command line after installing AVR mac pack? Not running that command will definitely cause strange things to happen to printf and scanf. Humberto |
October 23, 2010 by Ralphxyz |
re: "Except for those parts of the program that use the streams, both fprintf_P and printf_P don't output anything." You need to use Terminal screen in order to see anything on your mac! Open another Terminal window and Type in screen /dev/cu.PL2303-0000101D 115200 (adjust for your USB port). You should see the stream output. Ralph |
October 24, 2010 by bretm |
The tempsensor.c program writes to the LCD with one of the fprintf_P's, so they don't necessarily need a terminal. It looks like the only part missing is the part generated by
instead of the lcd_writes. |
October 25, 2010 by dthomas |
Thanks for all the feedback! @hevans: just to be sure, I reexecuted the
I then reprogrammed the chip, but the buggy behavior remains. @Raplhxyz: wow, somehow I had totally missed this. So thats what the UART library is for. Great. Except, nothing is being written to These two findings make me even more sure, that somehow the wrong libraries are being used. (@bretm: yeah, it seems like any writes to streams are not working). I also tried another chip (I ordered a bunch and now have some spares) but the same issue remains. Does anybody have an idea for further tests I could do? |
October 25, 2010 by Ralphxyz |
In light of the above and unless you get a better answer "Start Over From Scratch"!! Down load the source code again and do a default unzip. You changed things with your original unzip as illustrated by: "macbook:~/workspace/nerdkit/sample/tempsensor_edu dthomas$ make" A default unzip would have macbook:~/workspace/nerdkit/code/tempsensor_edu dthomas$ make. The code folder has the Nerdkit libraries (Code/libnerdkits) which might have gotten munged. Are your new mcu's from Nerdkits or from a distributer? If not from Nerdkits you'll need a bootloader installed. It's a pain I know but try it. Ralph |
October 25, 2010 by hevans (NerdKits Staff) |
Hi dthomas, Just to make sure the code is actually getting recompiled make sure you delete all the .hex and .o files in both the libnerdkits directory and the whichever directory you are working in (probably intitialload), then try make again. The make program tries to be smart about when it needs to recompile code, and if nothing has changed in the source files it does not attempt to compile the code again. Perhaps you just got a strange initial compile for some reason. Humberto |
October 26, 2010 by dthomas |
@Humberto, this did the trick! I deleted all I guess I must have missed @Ralphxyz, yup, restarting from scratch should also have done the trick... Thanks to @all who helped me out here :) yay! now to convert to ˚C... |
Please log in to post a reply.
Did you know that a piezoelectric buzzer can be used in reverse as a microphone? Learn more...
|