Pages: [1]   Go Down
Author Topic: [C++][FanController] Has it been done, or am i the first?  (Read 902 times)
0 Members and 1 Guest are viewing this topic.
NETHERLANDS
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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  smiley-grin
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

Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 509
Posts: 31483
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Can i just use fprintf() in the arduino software?
No.
Use Serial.println();
Logged

NETHERLANDS
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 509
Posts: 31483
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

NETHERLANDS
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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().
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 509
Posts: 31483
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

NETHERLANDS
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 509
Posts: 31483
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

NETHERLANDS
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Pages: [1]   Go Up
Jump to: