HI~Everyone~~
Now I have two input in cc2530(SW6 & SW8)
I want to change my these two inputs to outputs.
What should I do?
Any idea??
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
You should read the I/O chapter (Chapter 7) of the CC253x User Guide. There you will find that you need to modify P0DIR, P1DIR, or P2DIR, depending on which I/O pins SW6 and SW8 are connected to.
Is this your first attempt at embedded programming?
You still haven't said which I/Os you are referring to. I will use P0.0 and P0.1 in this example. I hope you will be able to change it to the I/Os that you are using:
P0_0 = 0; // Set P0.0 low
P0_1 = 0; // Set P0.1 low
P0DIR |= (1 << 0) | (1 << 1); // Set P0.1 and P0.1 as outputs