Legacy Forum: Preserving Nearly 20 Years of Community History - A Time Capsule of Discussions, Memories, and Shared Experiences.

how do i get the state of the buttons(up,down,...) in C

Bioloid robot kit from Korean company Robotis; CM5 controller block, AX12 servos..
4 postsPage 1 of 1
4 postsPage 1 of 1

how do i get the state of the buttons(up,down,...) in C

Post by Lenny » Thu Jul 19, 2007 8:46 pm

Post by Lenny
Thu Jul 19, 2007 8:46 pm

Hello,

how do i get the state of the buttons(up,down,...) in C (avr-gcc)?

The "Up"-Button is connected to the external-interrupt 4 as you can see her:
http://robosavvy.com/Builders/pepperm/CM-5%20Schematic%20V1.JPG

i use a interrupt-routine to catch the keypress-signal.

Code: Select all
SIGNAL (SIG_INTERRUPT4) //INT4 when Up-Key pressed
{
   PORTC &= ~_BV(PC3);  //turns AUX-LED on
}


has anyone a working code-snippet?

Bye
Lenny
Hello,

how do i get the state of the buttons(up,down,...) in C (avr-gcc)?

The "Up"-Button is connected to the external-interrupt 4 as you can see her:
http://robosavvy.com/Builders/pepperm/CM-5%20Schematic%20V1.JPG

i use a interrupt-routine to catch the keypress-signal.

Code: Select all
SIGNAL (SIG_INTERRUPT4) //INT4 when Up-Key pressed
{
   PORTC &= ~_BV(PC3);  //turns AUX-LED on
}


has anyone a working code-snippet?

Bye
Lenny
Lenny
Robot Builder
Robot Builder
User avatar
Posts: 8
Joined: Thu Jul 19, 2007 8:29 pm
Location: Bonn,DE

Post by Lenny » Sat Jul 21, 2007 8:27 pm

Post by Lenny
Sat Jul 21, 2007 8:27 pm

Hello,

i found the error. the pull-up resistor was not set for port E :roll:

Code: Select all
DDRE = 0;                  //set port E to input direction
PORTE |= _BV(PE4);    //enable pull-up resistor 4
EIMSK |= _BV(INT4);   //enable interrupt 4


Bye
Lenny
Hello,

i found the error. the pull-up resistor was not set for port E :roll:

Code: Select all
DDRE = 0;                  //set port E to input direction
PORTE |= _BV(PE4);    //enable pull-up resistor 4
EIMSK |= _BV(INT4);   //enable interrupt 4


Bye
Lenny
Lenny
Robot Builder
Robot Builder
User avatar
Posts: 8
Joined: Thu Jul 19, 2007 8:29 pm
Location: Bonn,DE

Post by StuartL » Thu Aug 16, 2007 11:14 am

Post by StuartL
Thu Aug 16, 2007 11:14 am

Have you mapped the port uses of the CM5? it's something I intended to do but haven't got to yet...
Have you mapped the port uses of the CM5? it's something I intended to do but haven't got to yet...
StuartL
Savvy Roboteer
Savvy Roboteer
Posts: 350
Joined: Mon Jun 04, 2007 3:46 pm
Location: Thatcham, Berkshire, UK

Post by StuartL » Thu Aug 16, 2007 11:18 am

Post by StuartL
Thu Aug 16, 2007 11:18 am

Scratch that question, the JPG you linked to contains everything I wanted to know, including that port F's A2D converters are free...

Hmm. 6 axis IMU on CM5 anyone?
Scratch that question, the JPG you linked to contains everything I wanted to know, including that port F's A2D converters are free...

Hmm. 6 axis IMU on CM5 anyone?
StuartL
Savvy Roboteer
Savvy Roboteer
Posts: 350
Joined: Mon Jun 04, 2007 3:46 pm
Location: Thatcham, Berkshire, UK


4 postsPage 1 of 1
4 postsPage 1 of 1