Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
OLIMEX PIC32 Pinguino Micro - button test
02-12-2015, 10:20 PM,
#1
OLIMEX PIC32 Pinguino Micro - button test
Code:
// Swap LED lights with push BUTTON
// For Olimex PIC32 Pinguino Micro

int BUTTON = 41;     // IDE pushbutton pin

void setup() {
  pinMode(GREENLED, OUTPUT);    
  pinMode(YELLOWLED, OUTPUT);      
  pinMode(BUTTON, INPUT);    
}

void loop(){

  if (digitalRead(BUTTON)) {      
    digitalWrite(GREENLED, HIGH);  
    digitalWrite(YELLOWLED, LOW);
  } else {
    digitalWrite(GREENLED, LOW);
    digitalWrite(GREENLED, HIGH);
  }
  
}

I am using V11beta4 and the above program compiles but the button does
not activate the LED's. Is thsi an IDE problem or have I missed something.

Thanks for the help
Reply
03-12-2015, 02:45 PM,
#2
RE: OLIMEX PIC32 Pinguino Micro - button test
I expect 41 is not the button.

Can't you use USERBUTTON?

John
Reply
04-12-2015, 05:32 AM, (This post was last modified: 04-12-2015, 05:56 AM by jwzumwalt.)
#3
RE: OLIMEX PIC32 Pinguino Micro - button test
I am glad you asked.

I am trying to troubleshoot a possible IDE problem.
pin 41 should work (according to the documentation).

CDC.printf("button=%d\r\n", USERBUTTON);

Reports USERBUTTON is #41.

But USERBUTTON does not work - I think it is a IDE
problem and not a hardware issue. That is why I was
hoping to find someone with a Pinguino Micro that could
confirm a working program Smile
----------------
Thanks,
j
wzumwalt
 (\__/)
 (='.'=)
 (")_(")
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)