hello! I’m trying to use MKR1000 with pulse sensor ( sensor : https://github.com/WorldFamousElectronics/PulseSensor_Amped_Arduino)
I’m testing with the sensor in arduino ide(ver 1.8.7 latest version)
I’m testing with the example code:
/* Getting_BPM_to_Monitor prints the BPM to the Serial Monitor, using the least lines of code and PulseSensor Library.
- Tutorial Webpage: Getting (Calculating) BPM: – World Famous Electronics llc.
--------Use This Sketch To------------------------------------------
- Displays user’s live and changing BPM, Beats Per Minute, in Arduino’s native Serial Monitor.
- Print: “
A HeartBeat Happened !” when a beat is detected, live.
- Learn about using a PulseSensor Library “Object”.
- Blinks LED on PIN 13 with user’s Heartbeat.
--------------------------------------------------------------------*/
#define USE_ARDUINO_INTERRUPTS true // Set-up low-level interrupts for most acurate BPM math.
#include <PulseSensorPlayground.h> // Includes the PulseSensorPlayground Library.
// Variables
const int PulseWire = A1; // PulseSensor PURPLE WIRE connected to ANALOG PIN 0
//const int LED13 = 13; // The on-board Arduino LED, close to PIN 13.
int Threshold = 550; // Determine which Signal to “count as a beat” and which to ignore.
// Use the “Gettting Started Project” to fine-tune Threshold Value beyond default setting.
// Otherwise leave the default “550” value.
PulseSensorPlayground pulseSensor; // Creates an instance of the PulseSensorPlayground object called “pulseSensor”
void setup() {
Serial.begin(9600); // For Serial Monitor
// Configure the PulseSensor object, by assigning our variables to it.
pulseSensor.analogInput(PulseWire);
//pulseSensor.blinkOnPulse(LED13); //auto-magically blink Arduino’s LED with heartbeat.
pulseSensor.setThreshold(Threshold);
// Double-check the “pulseSensor” object was created and “began” seeing a signal.
if (pulseSensor.begin()) {
Serial.println(“We created a pulseSensor Object !”); //This prints one time at Arduino power-up, or on Arduino reset.
}
}
void loop() {
int myBPM = pulseSensor.getBeatsPerMinute(); // Calls function on our pulseSensor object that returns BPM as an “int”.
// “myBPM” hold this BPM value now.
if (pulseSensor.sawStartOfBeat()) { // Constantly test to see if “a beat happened”.
Serial.println(" A HeartBeat Happened ! "); // If test is “true”, print a message “a heartbeat happened”.
Serial.print("BPM: "); // Print phrase "BPM: "
Serial.println(myBPM); // Print the value inside of myBPM.
}
delay(20); // considered best practice in a simple sketch.
}
library&example: https://github.com/WorldFamousElectronics/PulseSensorPlayground/tree/master/examples
I installed SAMD board by using Board Manager
but when I compiled+uploaded to mkr1000, it prints like
Sketch uses program storage 11256Byte(4%). Max is 262144Byte(I translated in my own… sorry…)
Atmel SMART device 0x10010005 found
Device : ATSAMD21G18A
Chip ID : 10010005
Version : v2.0 [Arduino:XYZ] Dec 20 2016 15:36:43
Address : 8192
Pages : 3968
Page Size : 64 bytes
Total Size : 248KB
Planes : 1
Lock Regions : 16
Locked : none
Security : false
Boot Flash : true
BOD : true
BOR : true
Arduino : FAST_CHIP_ERASE
Arduino : FAST_MULTI_PAGE_WRITE
Arduino : CAN_CHECKSUM_MEMORY_BUFFER
Erase flash
done in 0.837 seconds
Write 11560 bytes to flash (181 pages)
[========== ] 35% (64/181 pages)
[===================== ] 70% (128/181 pages)
[==============================] 100% (181/181 pages)
done in 0.077 seconds
Verify 11560 bytes of flash with checksum.
Verify successful
done in 0.016 seconds
CPU reset.
And after this, my micro usb connection(which is connected to mkr1000) was being disconnected&
reconnected(I didn’t touch anything after upload)…
as a result, I can’t get print in serial monitor… Can I get solution for this problem?
thank you!