parallel port

Technical questions regarding the XTC tools and programming with XMOS.
fareez
New User
Posts: 2
Joined: Sun Jul 31, 2011 11:31 pm

parallel port

Post by fareez »

Hi dears
I did not find CB here,
can u help me in this ?
I have xp, codeblocks 10.05
Pls I need example program in and out to parallel port
thanks


User avatar
rubenc
Active Member
Posts: 40
Joined: Fri Jul 22, 2011 2:31 pm

Post by rubenc »

fareez wrote:Hi dears
I did not find CB here,
can u help me in this ?
I have xp, codeblocks 10.05
Pls I need example program in and out to parallel port
thanks
You can find the info in the documentation section
http://www.xmos.com/support/documentation

But here you can have an example. ( taken from the documentattion) Programin XC on XMOS Devices.pdf page 18


# include <xs1 .h>
in port oneBit = XS1_PORT_1A ;
out port counter = XS1_PORT_4A ;
int main ( void ) {
int x;
int i = 0;
oneBit :> x;
while (1) {
oneBit when pinsneq (x) :> x;
counter <: ++i;
}
}
fareez
New User
Posts: 2
Joined: Sun Jul 31, 2011 11:31 pm

Post by fareez »

Dear sir
The compiler for Code::Blocks 10.05 gave these errors for that program:
|1|error: xs1 .h: No such file or directory|
|2|error: 'in' does not name a type|
|3|error: 'out' does not name a type|
In function 'int main()':|
|7|error: 'oneBit' was not declared in this scope|
|7|error: expected ';' before ']' token|
|9|error: expected ';' before 'when'|
|10|error: 'counter' was not declared in this scope|
|10|error: expected ']' before ';' token|
|5|warning: unused variable 'x'|
Please advise
Thanks
Fareez
User avatar
Bianco
XCore Expert
Posts: 754
Joined: Thu Dec 10, 2009 6:56 pm

Post by Bianco »

Hello,

To clearify things:

You want to create a program for Windows using the http://www.codeblocks.org/ IDE that can read and write to a (PC) parallel port? In that case i believe that this is not the right place to ask. You are better off on a more generic programming forum, for example: http://forums.devshed.com