Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: PWM control of Solenoid on Arduino

PWM control of Solenoid on Arduino 9 years 1 month ago #7375

  • brew
  • brew's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 108
  • Karma: 0
Hello All,

I have a quick question on PWM.

i made a "Ao" analog out and "ChanAo"
& connected them
and gave it a reference to pin 8 "number.... 8"
see attached PNG for the settings
i also set up a slider that is tied to "Av" that is connected to the "ChanAo "
so i can manually move it up and down to make the PWM work
slider goes from 0 - 255

it doesn't seem to be working.
i even went into the arduino code and added a
"pinMode" to make sure that pin8 was on, and set to "OUTPUT"

The Arduino test code works fine. The solennoids click on, then slowly close up.
(see below)

any ideas on what i did wrong??
How i get the Proview slider to control the Solenoids?

thanks guys!
Happy equinox, and happy solar eclipse! i am in usa, so didn't see it.. was it good?

================
arduino test for PWM code
 http://arduino.cc/en/Tutorial/Fading
 
 This example code is in the public domain.
 
 */

int ledPinA = 8; 
int ledPin = 9;    // LED connected to digital pin 9

void setup()  { 
  // nothing happens in setup 
} 

void loop()  { 
  // fade in from min to max in increments of 5 points:
  for(int fadeValue = 0 ; fadeValue <= 255; fadeValue +=5) { 
    // sets the value (range from 0 to 255):
    analogWrite(ledPin, fadeValue);         
    // wait for 30 milliseconds to see the dimming effect    
    delay(30);                            
  } 

  // fade out from max to min in increments of 5 points:
  for(int fadeValue = 255 ; fadeValue >= 0; fadeValue -=5) { 
    // sets the value (range from 0 to 255):
    analogWrite(ledPin, fadeValue);         
    // wait for 30 milliseconds to see the dimming effect    
    delay(30);  
  }
  
  // fade in from min to max in increments of 5 points:
  for(int fadeValue = 0 ; fadeValue <= 255; fadeValue +=5) { 
    // sets the value (range from 0 to 255):
    analogWrite(ledPinA, fadeValue);         
    // wait for 30 milliseconds to see the dimming effect    
    delay(40);                            
  } 

  // fade out from max to min in increments of 5 points:
  for(int fadeValue = 255 ; fadeValue >= 0; fadeValue -=5) { 
    // sets the value (range from 0 to 255):
    analogWrite(ledPinA, fadeValue);         
    // wait for 30 milliseconds to see the dimming effect    
    delay(40);     
  } 
}


AOsettings.png
Attachments:
The administrator has disabled public write access.

PWM control of Solenoid on Arduino 9 years 1 month ago #7399

  • claes
  • claes's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 3178
  • Thank you received: 502
  • Karma: 133
Hi Brew,

chaoPWMcold8.RawValRangeHigh should be 255.

/Claes
The administrator has disabled public write access.
The following user(s) said Thank You: brew

PWM control of Solenoid on Arduino 9 years 1 month ago #7400

  • brew
  • brew's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 108
  • Karma: 0
Thanks man!
works like a charm...
The administrator has disabled public write access.
  • Page:
  • 1
Time to create page: 8.512 seconds