Read two thousand two hundred and forty-six | return two

two

Posts

zero

TA resources

A grain of gold sand (primary)

Building owner
 

Error in input mode of cc3200 GPIO [Copy Link]

Use the DO of the photoresistor to output high and low levels, read the level value with the input of GPIO, and control the light on and off. However, the desired phenomenon is still not found. Moreover, Mingming turned off all the lights at the beginning, but it is still on. Here is the code

//control the input
void ReadDeviceConfiguration()
{
     unsigned int uiGPIOPort;
     unsigned char pucGPIOPin;
     unsigned char ucPinValue;

     GPIO_IF_LedOff(MCU_ALL_LED_IND);

     while(1){
         //Read PIN1 ucPinValue
     GPIO_IF_GetPortNPin(GPIOIN,&uiGPIOPort,&pucGPIOPin);
     ucPinValue = GPIO_IF_Get(GPIOIN, uiGPIOPort,pucGPIOPin);

     console.log(ucPinValue);
     //LIGHT slow
     if(ucPinValue == 1)
     {
         GPIO_IF_LedOn(MCU_RED_LED_GPIO);
     }
     //light high
     else
     {
         GPIO_IF_LedOff(MCU_RED_LED_GPIO);
     }

     //Enable GPIO Interrupt
     MAP_GPIOIntClear(GPIOA0_BASE,GPIO_PIN_7);
     MAP_IntPendClear(INT_GPIOA0);
     MAP_IntEnable(INT_GPIOA0);
     MAP_GPIOIntEnable(GPIOA0_BASE,GPIO_PIN_7);

     ucPinValue=0;
     }

}


int
main()
{
//Set vector table base Set the base address of the interrupt vector table, allow interrupts, and initialize MCU
    BoardInit();

    // Power on the corresponding GPIO port B for 9,10,11.
    // Set up the GPIO lines to mode 0 (GPIO)
    PinMuxConfig();

    GPIO_IF_LedConfigure(LED1|LED2|LED3);

    GPIO_IF_LedOff(MCU_ALL_LED_IND);

    ReadDeviceConfiguration();

    return 0;
}

Thanks~

This post is from Wireless Connection Forum

Latest reply

First, measure the output level of your IO, and then look at the lighting mode of your hardware LED lamp, whether the IO should be turned on for high level or low level.   details reply Published at 16:01, May 16, 2019
give the thumbs-up follow (1)
 

reply
report

Colorful wafer (advanced)

sofa
 
Regardless of the input status, the control light turns on and off. See if it can be realized, but it can't. There is a problem with the initialization configuration. Go to modify the initialization. If it can be realized, check the input configuration and control output logic.
This post is from Wireless Connection Forum
 
 
 

reply

Pure silicon (advanced)

Bench
 
First, measure the output level of your IO, and then look at the lighting mode of your hardware LED lamp, whether the IO should be turned on for high level or low level.
This post is from Wireless Connection Forum
 
 
 

reply
You need to log in before you can reply Sign in | register

look around
Find Data Book?

EEWorld Datasheet Technical Support

Related articles More>>
close
Recommended by webmaster Previous one /10  Next
Copyright Electronic Engineering World Beijing B2-20211791 Jing ICP Bei 10001474-1 TSSP [2006] No. 258 Jinggong Network Anbei No. 11010802033920 Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved
Quick reply Back to top Back to list