pwm pins won't work as normal digital pins

hi all,

I have a Arduino Duemilanove (Updated 328 Version) connected with flash using as3.I am using the digital pins to simply switch on a relay ie. just switch the power high.

However I need 8 pins for 8 relays, digital pins 0 and 1 are used for the flash to arduino connection, I am already using digital pins 2-7 and they work fine. I am however 2 pins short. I have tried to use pins between 8 and 13 but these all seem to be pwm pins.

I can get these pwm pins to fade a led up and down by calling them in flash as their pwm pins. However I want to use them as just ordinary digital pins, I have been told and have seen other peoples code which simply acess pins 8-13 just like they have accessed pins 2-7 using:

var ledPin:Number = 3; arduino.setPinMode(ledPin, Arduino.OUTPUT); arduino.writeDigitalPin(ledPin, Arduino.LOW);

When I try to use one of these pwm pins as a normal digital pin eg. change the:

var ledPin:Number = 3;

to something like

var ledPin:Number = 8;

and change the wiring according on my board it does nothing.

I am thinking it is something to do with my firmdata maybe but I can't find one which allows me to referance the pwm pins as normal digital pins.

I had heard that maybe baud rates was to blame but im really stumped.

any help would be much appreciated

oh btw the firmdata I have been trying are the ones supplied with arduino-017 and also the glue ones

regards booba23

Don't worry guys I answered my own question, I just make the pwm power 255 to equal on and 0 to equal off

regards booba23

Keep in mind that the Arduino analog pins are also avalible to be used as digital pins. Just address them as pins digital pins 14-19.


I have read that, was indeed the case but whilst to trying to figure out my problem I did try that referencing the analog pins as 14-19 but it didn't work.

Possible because I am accessing them through flash and not actually coding it in the arduino code.

Any how I have it working, but thx for the suggestion, if I need a lot of pins in another project i will definately check out that possibility

regards booba23