The sketch is missing code tags! Please read the sticky post at the top of the topic.
The sketch is not complete, it won't compile. Please post only complete sketches.
Post a wiring diagram of your setup. If you don't use the sensor directly but by some breakout board, post a link to the schematics of this board. Depending on the wiring this sketch (if completed) might work.
will this code work on :
#include<SoftwareSerial.h> #define counter_delay 20
int maxi = 0, mini = 5000;
int k = 0, i = 0;
volatile int pulse_count;
volatile int req_pulse;
int pin = 3; //INTERRUPT
int pin_irq = 1; //IRQ that matches to pin 2 INT 1
char Sensor;
SoftwareSerial mani(3,4);
how it works means. color sensor will print the value continuously. if any disturbance occurs it should not print the value . it should print some text ..
pin connection:
vcc and gnd to tiny
output of color sensor to the 5th physical pin of tiny.
tx of tiny (3rd physical pin) given to uno rx.
rx of tiny (2nd physica pin) given to uno tx.
this the connection.. after uploading the program to attiny85.
software serial program will be uploaded to uno. to watchh the value on serial monitor