Joined: 28 Aug 2007 Posts: 99 Location: New Zealand
Pin definition help
Posted: Mon Dec 01, 2008 2:17 am
I want to be able to have a code segment that will output_high(Output_(i)) or output_low(output_(i)), were output_(i) is assigned to a certain pin, such as #define output_0 pin_a0, #define output_1 pin_b3 ect. The idea is to have (i) as an int8 that can be manipulated easily between 0 and the number of outputs required and thus minimize my code.
Don’t really know how to do it for the output. For reading inputs it was easy all I did was.
Make an int16 array with the number of elements equal to the number of outputs you want to switch. then initialize the array with the pin defines. This does require more processing power if I'm not mistaken....
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum