Can I get an example of code to be pasted into the C code icon for FC5 that shows a simple example to:
Look at an input
Turn on an output.
Thanks
C code
Moderator: Benj
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: C code
Hello,
Lets say you have a flowcode variable named test.
Some chips have a LAT register as well as a port register, in which case the output code becomes.
Lets say you have a flowcode variable named test.
Look at an input
Code: Select all
trisb = 0xFF; // convert RB0-RB7 to Input
FCV_TEST = portb; // read the value being input to portb pins
Turn on an output.
Code: Select all
trisb = 0x00; // convert RB0-RB7 to output
portb = FCV_TEST; // assign value in test variable to portb pins
Code: Select all
trisb = 0x00; // convert RB0-RB7 to output
latb = FCV_TEST; // assign value in test variable to portb pins
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel