Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Getting started with Udoo
  • Toc
  • feedback
Getting started with Udoo

Getting started with Udoo

By : Emanuele Palazzetti
4.8 (4)
close
Getting started with Udoo

Getting started with Udoo

4.8 (4)
By: Emanuele Palazzetti

Overview of this book

If you are an Android developer who wants to learn how to use UDOO to build Android applications that are capable of interacting with their surrounding environment, then this book is ideal for you. Learning UDOO is the next great step to start building your first real-world prototypes powered by the Android operating system.
Table of Contents (10 chapters)
close
9
Index

Collecting data from the sketch

Now that we have a working circuit, we should start to write down our sketch to collect data from the light sensor. Then we should analyze these results and think about an algorithm to transform readings into a heartbeat counter. We should start a new sketch and add the following steps:

  1. Add the following declarations on the top of the sketch:
    #define SENSOR A0
    #define HEARTBEAT_POLL_PERIOD50
    #define SECONDS 10
    constint TIMESLOTS = SECONDS * 1000 / HEARTBEAT_POLL_PERIOD;
    int sensorReading = 0;

    We define the object-like macro SENSOR with a A0 value that is the pin we will use for the analog read. We set HEARTBEAT_POLL_PERIOD to specify how many milliseconds the microcontroller should wait between consecutive sensor readings. With the SECONDS parameter, we define the seconds that should elapse before we use collected data to process and estimate the heart rate. Indeed, we multiply SECONDS by 1000 to convert this value into milliseconds and then we divide it by...

bookmark search playlist font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete