How to use Individual port bit

General discussion on RSC-4x mikroC.
Post Reply
Author
Message
chessy
Posts: 9
Joined: 19 Jun 2006 17:30
Location: Thailand

How to use Individual port bit

#1 Post by chessy » 19 Jun 2006 18:17

Hi All,

I am new for mikroC rsc4x compiler and
I never use compiler from mikroe before.

1 . I need some example for using individual port bit for digital input and output. I see code in file "led_blinking.c" (send data to port) but I need to
set or clear some bit like this.

use in ccs c compiler for microchip PIC

Code: Select all

#define  LED            PIN_A0      <-- can I define or declare each pin in mikroC rsc4x or another way to use each pin
#define  btnSTART    PIN_A1

if(~btnSTART)
   LED = 1;
else
   LED = 0;
2. Is there example code for speech recognition?
I buy easy VR Stamp for development speech recognition project but
I not found example about it
:cry:

chessy

questionsandanswers
Posts: 10
Joined: 18 Jun 2006 16:34

#2 Post by questionsandanswers » 19 Jun 2006 19:21

i alsa want to learn to use ports as inputs and outputs. but to use individual port pins, you can use bitwise operators like,

p2out=0b00000000;
p2out=0b00000001;

here in the first the P20 is 0. then it comes to be 1. by using 0b we say it is a binary output. so u can control each pin.

qanda

PS: i know this but i don't know how to set pins as outputs or inputs????

chessy
Posts: 9
Joined: 19 Jun 2006 17:30
Location: Thailand

#3 Post by chessy » 20 Jun 2006 05:22

I know to use about bit wise but I want to declare some bit to another name like

Code: Select all

 LED <---> p1.0  I use LED as p1.0

Post Reply

Return to “RSC-4x mikroC General”