Attachment 'GEERTCODE.ino'
Download 1 const int Baudrate = 19200;
2 const int Digital_Input_Pin = 3; // the pin that the heart-rate sensor is attached which contains INT0
3 //let op pin 2 bij handgemaakte experimenteerprint, pin3 bij pcb bordje van geert vdb
4
5 void setup() {
6 Serial.begin(Baudrate); // For sending data to the computer over USB
7 pinMode(Digital_Input_Pin, INPUT);
8 attachInterrupt(0, Send_Interval, RISING); // Attach to INT0
9 }
10
11 void loop() {
12 // nothing to do, its all in the interrupt handlers!
13 }
14
15 unsigned long LastTime, NewTime, j;
16 void Send_Interval() {
17 NewTime = micros(); // Resolution 4us, only one overrun in 70 minutes
18 Serial.println(NewTime-LastTime, HEX);
19 LastTime = NewTime;
20 }
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.You are not allowed to attach a file to this page.