File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -39,23 +39,25 @@ void setup() {
3939 // Change PWM Frequency for Timer2.
4040 // Copied the relevant part from here:
4141 // http://playground.arduino.cc/Code/PwmFrequency
42+ // f=~31kHZ
4243 TCCR2B = TCCR2B & 0b11111000 | 0x01 ;
4344 Serial.begin (115200 );
4445 // reserve 200 bytes for the inputString:
4546 inputString.reserve (200 );
4647}
4748
4849void setCurrent (float i) {
49- if (i > 100.00 ) { i = 100.00 ; }
50- int iDigit = i*1.97 ;
50+ // Lock to Max.
51+ if (i > 100.00 ) { i = 110.00 ; }
52+ int iDigit = i*1.535 ;
5153 analogWrite (laserMod, iDigit);
5254 Serial.println (" OK\r " );
5355}
5456
5557float getVoltage () {
5658 int ctlOut = analogRead (laserCTL);
5759 // Convert the analog reading (which goes from 0 - 1023) to a voltage (0 - 5V):
58- return ctlOut*0.0049 ; // voltage
60+ return ctlOut*0.005 ; // voltage
5961}
6062
6163float getCurrent () {
You can’t perform that action at this time.
0 commit comments