Toggle several IOs of a port at the same time.

Dependencies:   mbed

Committer:
arostm
Date:
Wed Jun 07 14:13:34 2017 +0000
Revision:
1:9b2cf74ea65b
Parent:
0:5409e32ac226
Adding new mbed library

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bcostm 0:5409e32ac226 1 #include "mbed.h"
bcostm 0:5409e32ac226 2
bcostm 0:5409e32ac226 3 #define IOS (0xA0) // PA_5 + PA_7
bcostm 0:5409e32ac226 4
bcostm 0:5409e32ac226 5 PortOut myIOs(PortA, IOS);
bcostm 0:5409e32ac226 6
bcostm 0:5409e32ac226 7 int main() {
bcostm 0:5409e32ac226 8 while(1) {
bcostm 0:5409e32ac226 9 myIOs = myIOs ^ IOS; // Toggle IOs level
bcostm 0:5409e32ac226 10 wait(0.5); // 500 ms
bcostm 0:5409e32ac226 11 }
bcostm 0:5409e32ac226 12 }
bcostm 0:5409e32ac226 13