Go Down

Topic: [C++][FanController] Has it been done, or am i the first? (Read 1 time) previous topic - next topic

thajehova

As a project i want to make a device, which controlles my computer fans.

The fans i use arn't PWM fans, but that doesnt really matter, for u can PWM them anyways  :D
Since the Arduino Uno i got 5V outputs, I added a circuit with some MOSFETs (BUZ11) to get them up to 12V. PWM-ing them works like a charm (if the PWM-frequency is increased; it kills the buzz).

Now i want to read out the PWM-percentages. Can i just use fprintf() in the arduino software? Or do i have to work around that, witch will be a pain in the a**

In the future i also planned on reading out temps(either LM35s or a voltage-deviding NTC), but that's for the future

Help will much be appreciated,

ThaJehova


Grumpy_Mike

Quote
Can i just use fprintf() in the arduino software?

No.
Use Serial.println();

thajehova

Im talking about fprintf() not printf()  :smiley-eek:
So not printing to the terminal, but to a file.

Grumpy_Mike

What file? The arduino has no way of writing to files. Where are the files stored?

You can write to an SD card but not with this. You need an SD shield.

thajehova

in c++ one can write just as easily to a .txt file as printing in the command line.
with fpintf() and printf().
printf() ==> Serial.printIn(), i know. But i've got no idea about fprintf().

Grumpy_Mike

Yes that is C running on a computer with a file storage system. You are
on an arduino with no file storage system. There is no physical place to put the file. So fprintf() will not do anything for you.


thajehova

but the arduino is sending it to my computer, otherwise i could've never know what he'd be reading. There must be a way to intercept the serial connection or copy it out of the arduino's-software-console-unit into a file or into a c(++) program.

Grumpy_Mike

Yes there is but that's not what you asked.

You use the Serial.print() on the arduino and then on the computer you write a program (in what ever language) to gather the data from the serial port and put it into a file.
I would recommend processing as a free language.

thajehova

Thank you, processing does the trick. Kinda forgot the arduino was a computer in itself :smiley-sweat:

Go Up