It is currently Tue Feb 18, 2020 1:20 pm
       


All times are UTC + 1 hour




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: reading binary inputs at EDUCATION ROBOT ARM HOBBY V3
PostPosted: Thu Aug 10, 2017 10:30 am 
Offline
New User

Joined: Thu Aug 10, 2017 9:06 am
Posts: 1
Dears I have question how to read one binary input at AREXX EDUCATION ROBOT ARM HOBBY V3. I know how to set binary output but I have not idea how to read binary input. I need read two or three binary inputs what I am conntroling from the external PLC.
There is my part of C code. I need just write one binary input to one bool variable.
setLEDs(0b0000);
//mSleep(1000);
//setLEDs(0b0011);
writeString_P(" \n");
writeString_P("Port-C Initialisierung\n");
DDRC = (1<<DDC7)|(1<<DDC6)|(1<<DDC5)|(1<<DDC4)|(1<<DDC3)|(1<<DDC2)|(0<<DDC1)|(0<<DDC0); // Define directions for port pins
PORTC = (0<<PC7)|(0<<PC6)|(0<<PC5)|(0<<PC4)|(0<<PC3)|(0<<PC2)|(0<<PC1)|(0<<PC0); // Define pull-ups and set outputs high
writeString_P(" \n");
writeInteger(PINC,DEC);
setLEDs(0b0001);
delay_ms(2000); //wait for 2 second
PORTC = PORTC | (1<<2); // zusatz PortC (PINC2) einschalten
PORTC = PORTC | (1<<3); // zusatz PortC (PINC2) einschalten
writeString_P(" \n");
writeInteger(PINC,DEC);
delay_ms(2000); //wait for 2 second
setLEDs(0b0011);
writeString_P(" \n");
writeString_P("zusatz PortC (PINC) einschalten und LED 0011 aktivieren\n");
PORTC = PORTC & (~(1<<2)); // status PortC (PINC2 ) off
PORTC = PORTC & (~(1<<3)); // status PortC (PINC2 ) off ? or PINC3? off
writeString_P(" \n");
writeInteger(PINC,DEC);
writeString_P(" \n");
writeString_P("zusatz PortC (PINC) auschalten und LED 0111 aktivieren\n");
setLEDs(0b0111);

mSleep(1000);
setLEDs(0b1111);
writeString_P(" \n");
writeString_P("Program Ende und LED 1111 aktivieren\n");
mSleep(1000);
setLEDs(0b0000);
s_Move(6, -700,2);
s_Move(5, -300,2);
s_Move(1, -500,2); // kinnbacken geöffnet

Also I have problem when I am swich on ROBOT ARM its going to start position too much quickly.
Thanks for help
Ladi. :)


Top
 Profile E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group