Minor edits to air_quality_sensor.md and air_quality_ble.md. Added note about requiring multiboot gcc if running on a 64-bit machine This closes #143. This closes #130 since the adc tutorial will be rewritten to use our new HAL and driver framework.
Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/commit/f7bf83e0 Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/tree/f7bf83e0 Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/diff/f7bf83e0 Branch: refs/heads/develop Commit: f7bf83e01dde1958b1fec7b4cb6656edd4982348 Parents: 4bd1577 Author: aditihilbert <[email protected]> Authored: Thu Jan 19 14:57:06 2017 -0800 Committer: aditihilbert <[email protected]> Committed: Thu Jan 19 15:02:33 2017 -0800 ---------------------------------------------------------------------- docs/os/get_started/project_create.md | 2 ++ docs/os/tutorials/air_quality_ble.md | 31 ++++++++++++++-------------- docs/os/tutorials/air_quality_sensor.md | 3 +-- 3 files changed, 18 insertions(+), 18 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/f7bf83e0/docs/os/get_started/project_create.md ---------------------------------------------------------------------- diff --git a/docs/os/get_started/project_create.md b/docs/os/get_started/project_create.md index 0e9fd19..9f9c9e7 100644 --- a/docs/os/get_started/project_create.md +++ b/docs/os/get_started/project_create.md @@ -238,6 +238,8 @@ Compiling image_validate.c **NOTE:** If you've installed the latest gcc using homebrew on your Mac, you will likely be running gcc-6. Make sure you have adjusted the compiler.yml configuration to reflect that as noted in [Native Install Option](native_tools.md). You can choose to downgrade to gcc-5 in order to use the default gcc compiler configuration for MyNewt. +**NOTE** If you are running the standard gcc for 64-bit machines, it does not support 32-bit. In that case you will see compilation errors. You need to install multiboot gcc (e.g. gcc-multilib if you running on a 64-bit Ubuntu). + ``` $ brew uninstall gcc-6 $ brew link gcc-5 http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/f7bf83e0/docs/os/tutorials/air_quality_ble.md ---------------------------------------------------------------------- diff --git a/docs/os/tutorials/air_quality_ble.md b/docs/os/tutorials/air_quality_ble.md index c4b085d..7497d19 100644 --- a/docs/os/tutorials/air_quality_ble.md +++ b/docs/os/tutorials/air_quality_ble.md @@ -1,7 +1,7 @@ ## Air quality sensor project via Bluetooth -This is a follow-on project to the [Basic Air Quality Sensor](air_quality_sensor.md) project so it is -assumed that you have worked through that project and have your CO2 sensor working properly with +This is a follow-on project to the [Basic Air Quality Sensor](air_quality_sensor.md) project; so it is +assumed that you have worked through that project and have your CO<sub>2</sub> sensor working properly with your Arduino Primo board. So let's get started making this thing Bluetooth enabled! @@ -13,7 +13,7 @@ app most of the bluetooth plumbing has already been taken care of for us. What's to add the required GATT services for advertising the Carbon Dioxide sensor so that other devices can get those values. -First, we'll define the GATT Serivces in `apps/air_quality/src/bleprph.h` +First, we'll define the GATT Services in `apps/air_quality/src/bleprph.h`. ```c /* Sensor Data */ @@ -29,10 +29,10 @@ uint16_t gatt_co2_val; ``` You can use any hex values you choose for the sensor type and sensor values, and you can -even forgoe the sensor type and sensor string definitions altogether but they make +even forget the sensor type and sensor string definitions altogether but they make the results look nice in our Bleutooth App. -Next well add those services to `apps/air_quality/src/gatt_svr.c` +Next we'll add those services to `apps/air_quality/src/gatt_svr.c`. ```c static int @@ -44,7 +44,7 @@ static uint16_t gatt_co2_val_len; ``` -And make sure it is added as *primary* service +Make sure it is added as *primary* service. ```c static const struct ble_gatt_svc_def gatt_svr_svcs[] = { @@ -89,7 +89,7 @@ static const struct ble_gatt_svc_def gatt_svr_svcs[] = { }; ``` -Next we need to tell the GATT Server how to handle requests for CO2 readings : +Next we need to tell the GATT Server how to handle requests for CO<sub>2</sub> readings : ```c static int @@ -115,7 +115,7 @@ gatt_svr_sns_access(uint16_t conn_handle, uint16_t attr_handle, rc = gatt_svr_chr_write(ctxt->om, 0, sizeof gatt_co2_val, &gatt_co2_val, - &gatt_co2val_len); + &gatt_co2_val_len); return rc; } else if (ctxt->op == BLE_GATT_ACCESS_OP_READ_CHR) { rc = os_mbuf_append(ctxt->om, &gatt_co2_val, @@ -130,11 +130,10 @@ gatt_svr_sns_access(uint16_t conn_handle, uint16_t attr_handle, } ``` -Now it's time to go into our `apps/air_quality/src/main.c` and change how we read CO2 readings and +Now it's time to go into our `apps/air_quality/src/main.c` and change how we read CO<sub>2</sub> readings and respond to requests. -We'll need a task handler, etc. for the co2 readings -- they were handled by the shell task but -now they need to be handled separately. +We'll need a task handler with an event queue for the CO<sub>2</sub> readings -- they were handled by the shell task in the previous tutorial but now it needs to be replaced by a different handler as shown below. ```c /* CO2 Task settings */ @@ -146,7 +145,7 @@ bssnz_t os_stack_t co2_stack[CO2_STACK_SIZE]; ``` And of course we'll need to go to our `main()` and do all the standard task and event setup we -normally do by adding this: +normally do by adding the following. Again, remember to delete all the shell event queues and tasks. ```c /* Initialize sensor eventq */ @@ -208,13 +207,13 @@ err: ``` You'll notice that it looks eeirily similar to a portion of the shell event we created -earlier. This one just reads and updates the CO2 value and sends that over BLE to any -connected clients. +earlier. This one simply reads and updates the CO<sub>2</sub> value and sends that over BLE to any +connected clients instead. We can now build, create-image and load the app onto our Arduino Primo board, and then connect and see the updated values! The image below shows the results using MyNewt Sensor Reader, -a Mac OS X app developed for conecting to MyNewt devices over Bluetooth but you can also use LightBlue -or any other application that can conect to, and read, Bluetooth data. +a Mac OS X app developed for connecting to MyNewt devices over Bluetooth but you can also use LightBlue +or any other application that can connect to, and read, Bluetooth data.  http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/f7bf83e0/docs/os/tutorials/air_quality_sensor.md ---------------------------------------------------------------------- diff --git a/docs/os/tutorials/air_quality_sensor.md b/docs/os/tutorials/air_quality_sensor.md index 2881e34..3e94a7e 100644 --- a/docs/os/tutorials/air_quality_sensor.md +++ b/docs/os/tutorials/air_quality_sensor.md @@ -43,8 +43,7 @@ Your project.yml file should look like this: Good. You want to make sure you have all the needed bits for supporting your board; so you decide to build the blinky project for the platform first. -Now create a target for it and build it. Easiest way to proceed is to copy the existing t -arget for blinky, and modify it to build for Arduino Primo board. +Now create a target for it and build it. Easiest way to proceed is to copy the existing target for blinky, and modify it to build for Arduino Primo board. ```no-highlight [user@IsMyLaptop:~/src/air_quality]$ newt target copy my_blinky_sim blink_primo
