Search the Community
Showing results for tags 'bit1 to port1'.
Found 1 result
Hi Folks, I'm new to Autoit and I'm messing around with some SPI device interfacing. What I am trying to do is Map specific output Ports on my connected device to reflect a specific bit within a variable. So for instance if I have an integer: Local $iOUTPUTS = 0xAFand I have 8 separate Output ports on my device: declared as: POUT0 to POUT7 So within Autoit, how can I assign specific Bits from the same variable to different Ports on my device? Essentially what I'm trying to do is create a parallel port on my SPI device using its I/O ports and have it reflect a single Variable. Bit0 of "iOUPOUTS" = PORT0 Bit1 of "iOUPOUTS" = PORT1 Bit2 of "iOUPOUTS" = PORT2 Bit3 of "iOUPOUTS" = PORT3 Bit4 of "iOUPOUTS" = PORT4 Bit5 of "iOUPOUTS" = PORT5 Bit6 of "iOUPOUTS" = PORT6 Bit7 of "iOUPOUTS" = PORT7 In C programming I believe this is done using a LAT function like that shown below: #define RB15 LATBbits.LATB15 #define RB14 LATBbits.LATB14 #define RB13 LATBbits.LATB13 #define RB12 LATBbits.LATB12 #define RB11 LATBbits.LATB11 #define RB10 LATBbits.LATB10 #define RB6 LATBbits.LATB6 #define RB5 LATBbits.LATB5 #define RB4 LATBbits.LATB4However I need to implement this within Autoit and I'm wondering if there is a way to do this? Any help would be greatly appreciated. Cheers! -Billy