Me desculpem, mas eu disse o que queria, bom deixa pra lá, mas tentando chequei a isso.
O que eu quero é q aciono botao 1 vez acende o led1, aciono de novo apago o led1 e acende o led2 e assim por diante até chegar ao led9, ai zera tudo, olhem os arquivos abaixo nao consigo sair disso, com 2 leds no site do Filipflop funciona mas com 9 na dá. Obrigado
#include <16F628A.h>
//configuração FUSES
#FUSES NOWDT
#FUSES INTRC_IO
#FUSES NOPUT
#FUSES NOPROTECT
#FUSES NOBROWNOUT
#FUSES NOMCLR
#FUSES NOLVP
#FUSES NOCPD
//Definicoes portas
#define BOTAO PIN_B4
#define PINO_LED1 PIN_A0
#define PINO_LED2 PIN_A1
#define PINO_LED3 PIN_A2
#define PINO_LED4 PIN_A3
#define PINO_LED5 PIN_A4
#define PINO_LED6 PIN_B0
#define PINO_LED7 PIN_B1
#define PINO_LED8 PIN_B2
#define PINO_LED9 PIN_B3
//Define clock
#use delay(clock=4000000)
void main()
{
unsigned int status=0;
while(1)
{
//Verifica se o botao foi pressionado
if(input_state(BOTAO) ==0)
{
//Altera status led1
output_bit(PINO_LED1, status);
//Altera Status led2
output_bit(PINO_LED2, status);
//Altera Status led3
output_bit(PINO_LED3, status);
//Altera Status led4
output_bit(PINO_LED4, status);
//Altera Status led5
output_bit(PINO_LED5, status);
//Altera Status led6
output_bit(PINO_LED6, status);
//Altera Status led7
output_bit(PINO_LED7, status);
//Altera Status led8
output_bit(PINO_LED8, status);
//Altera Status led9
output_bit(PINO_LED9, status);
delay_ms(500);
//Inverte o valor da variável status
status=!status;
}
}
}