Hello guys, I am new here, and I am having a problem programming this Tig Pulser for my welder.
This is my code.
//Vars
int PWM_DutyCycle=0;
int PWM_DutyCycle_Pin=A0;
int PWM_Period=512; //period in ms
int PWM_Period_Pin=A1;
//Scale the time of the period or duty by N*1024 milliseconds.
//e.g. PWM_PeriodScale=5 will allow a maximum PWM period of 5120 milliseconds, or ~.195 Hz
int PWM_PeriodScale = 4;
int PWM_DutyScale = 4;
int PWM_Out_Pin = 9; //31250 base frequency (Timer1)
bool SimpleMode = 1; //NOTE - Other mode is not implemented!
int ADC1Vals[] = {0,0,0};
int ADC2Vals[] = {0,0,0};
unsigned long HighTime=1;
unsigned long LowTime=0;
void setup() {
//Set up PWM output
pinMode(PWM_Out_Pin, OUTPUT);
}
void loop() {
ReadPots();
HighTime = PWM_DutyCycle*PWM_DutyScale;
LowTime = PWM_Period*PWM_PeriodScale;
//turn on the out pin
digitalWrite(PWM_Out_Pin,HIGH);
delay(HighTime);
ReadPots();
HighTime = PWM_DutyCycle*PWM_DutyScale;
LowTime = PWM_Period*PWM_PeriodScale;
//turn pin off
digitalWrite(PWM_Out_Pin,LOW);
delay(LowTime);
}
Void ReadPots()
The errors I am getting are,
Tig_Pulser:50:1: error: 'Void' does not name a type
Void ReadPots()
^
exit status 1
'ReadPots' was not declared in this scope
Now, if I delete the ReadPots in the loop, and also delete the Void ReadPots, then it uploads to the Mini Pro, but, when I connect to the machine, the pots aren't working at all.
I've also tried changing:
int PWM_DutyCycle=0;
int PWM_DutyCycle_Pin=A0;
int PWM_Period=512; //period in ms
int PWM_Period_Pin=A1;
to:
int PWM_DutyCycle=0;
int PWM_DutyCycle_Pin=analogRead(A0);
int PWM_Period=512; //period in ms
int PWM_Period_Pin=analogRead(A1);
I'm new to this, so be patient with me please.
I got this code and the schematic for wiring it up from this person here. YouTube 'This Stuff I Do' Tig Pulser
I also read that A0 pin needs to be disconnected (I read this somewhere) before uploading program. I have already soldered this thing to the board. But I did try unsoldering that one pin, and still same results.
Any help is appreciated.
Thanks in advance, Falcon69
