Jump to content
43oh

ZenClide

Members
  • Content Count

    5
  • Joined

  • Last visited

Reputation Activity

  1. Like
    ZenClide reacted to Fmilburn in attachInterrupt example in CC3200   
    @@ZenClide
     
    The labels can be confusing.  Energia uses a pin numbering system that is consistent on all boards.  It starts with 3V3 (number 1) in the upper left, goes down to number 10 at lower left, and then starts up again on the other side at the bottom.  See for example the pin map at Energia for the CC3200:  http://energia.nu/wordpress/wp-content/uploads/2014/06/LaunchPads-CC3200-%E2%80%94-Pins-Maps-12-28.jpeg
     
    The pin map excerpt you have posted shows the same pin numbers right after the /* comments.
     
    So, pin 4 in Energia on the CC3200 is the same one that is labelled P03 on the board.  Energia pin 3 is labelled P04 on the board.  For Energia always use the Energia pin map and not the PCB labels.    The CC3200 User Manual refers to the PCB labels as the "Dev Pin#".  Use of port.pin type markings on LaunchPads has been deprecated in Energia.
  2. Like
    ZenClide reacted to Fmilburn in attachInterrupt example in CC3200   
    Hi @@ZenClide
     
    I tried it just now on a CC3200, Energia V17 without EMT and it worked fine other than the expected bounce from the switch... I hooked up a pushbutton switch to pin 4 and ground (without a pullup) as shown in the photo below:

    I used the following sketch:
    #define PUSH4 4 volatile int state = HIGH; volatile int flag = HIGH; int count = 0; void setup() { Serial.begin(9600); pinMode(GREEN_LED, OUTPUT); digitalWrite(GREEN_LED, state); /* Enable internal pullup. * Without the pin will float and the example will not work */ pinMode(PUSH4, INPUT_PULLUP); attachInterrupt(PUSH4, blink, FALLING); // Interrupt is fired whenever button is pressed } void loop() { digitalWrite(GREEN_LED, state); //LED starts ON if(flag) { count++; Serial.println(count); flag = LOW; } } void blink() { state = !state; flag = HIGH; }
  3. Like
    ZenClide reacted to Rei Vilo in attachInterrupt example in CC3200   
    Use INPUT_PULLUP instead of INPUT.
     
    See pinMode() and INPUT_PULLUP at Energia.nu.
×
×
  • Create New...