Sapphire 0 Posted May 16, 2020 Share Posted May 16, 2020 Hi. I seem to get the following error whenever I try using "GPIOPinConfigure()" as shown below: However I do NOT get the error whenever the function "GPIOPinConfigure()" is NOT used: In essence, I want to be able to make a SSI connection with two TM4C123GH6PM launchpads in order to send temperature information (from one end) and print it onto a Kentec LCD screen (at the other end). The complete code of the sender is posted in the following: #include <LiquidCrystal.h> #include <DHT.h> #include <stdint.h> #include <stdbool.h> #include "inc/hw_memmap.h" #include "inc/hw_types.h" #include "driverlib/gpio.h" #include "driverlib/pin_map.h" #include "driverlib/sysctl.h" #include "driverlib/uart.h" #include "inc/hw_ints.h" #include "driverlib/interrupt.h" #define DHTPIN PF_0 // GPIO pin for data #define DHTTYPE DHT22 //Type of sensor (DHT11 or DHT22) DHT dht(DHTPIN, DHTTYPE); //LCD Print LiquidCrystal lcd(PD_1, PD_2, PD_3, PE_1, PE_2, PE_3); void setup() { // put your setup code here, to run once: Serial.begin(115200); //Serial Baud rate Serial.println("DHT22 test!"); dht.begin(); lcd.begin(16, 2); lcd.print("TEST"); delay(2000); lcd.clear(); } /*void UARTIntHandler(void) { uint32_t ui32Status; ui32Status = UARTIntStatus(UART0_BASE, true); //get interrupt status UARTIntClear(UART0_BASE, ui32Status); //clear the asserted interrupts while(UARTCharsAvail(UART0_BASE)) //loop while there are chars { UARTCharPutNonBlocking(UART0_BASE, UARTCharGetNonBlocking(UART0_BASE)); //echo character GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_2, GPIO_PIN_2); //blink LED SysCtlDelay(SysCtlClockGet() / (1000 * 3)); //delay ~1 msec GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_2, 0); //turn off LED } }*/ void loop() { //put your main code here, to run repeatedly: SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ); SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA); //GPIOPinConfigure(GPIO_PA0_U0RX); /*GPIOPinConfigure(GPIO_PA0_U0RX); GPIOPinConfigure(GPIO_PA1_U0TX); GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF); GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_2); UARTConfigSetExpClk(UART0_BASE, SysCtlClockGet(), 115200, (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE)); IntMasterEnable(); IntEnable(INT_UART0); UARTIntEnable(UART0_BASE, UART_INT_RX | UART_INT_RT);*/ lcd.noDisplay(); delay(200); lcd.display(); delay(200); delay(2000); float h = dht.readHumidity(); float t = dht.readTemperature(); float f = dht.readTemperature(true); if (isnan(h) || isnan(t) || isnan(f)) { Serial.println("Failed to read from DHT sensor!"); return; } // Prints results on serial monitor Serial.print("Humidity: "); Serial.print(h); Serial.print(" %\t"); Serial.print("Temperature: "); Serial.print(t); Serial.print(" *C"); Serial.print(", "); Serial.print(f); Serial.println(" *F "); // Prints on LCD lcd.setCursor(0, 1); lcd.print("HUMID% = "); lcd.print(h); lcd.println(" %" ); lcd.setCursor(1, 0); lcd.print(" TEMP = "); lcd.print(t); lcd.println("*C"); } I hope someone can help me address this error. Thank you. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.