Quantcast
Channel: MSP430 Technical Forums
Viewing all articles
Browse latest Browse all 2077

analogWrite bug with msp430g2553 in energia

$
0
0

Hello,

 

When I execute the code below, and check P2_1 and P2_2 on my scope, I see that both pins are 128, i.e, whichever analogWrite statement takes place the last, it overrides the one before. I am using launchpad v1.4

 

If I write 0 to one of the pins, it will work correctly.

 

void setup()
{
 
   pinMode(P2_1, OUTPUT); 
   pinMode(P2_2, OUTPUT);   
   
   analogWrite(P2_1, 32);
   analogWrite(P2_2, 128);  
   
}
 
unsigned long time;
 
void loop()
{
  time = millis();
  delay(100);  
}

Viewing all articles
Browse latest Browse all 2077

Trending Articles