Skip to content

Commit 2443388

Browse files
committed
Update tutorials (single commit)
Signed-off-by: C-D-Lewis <[email protected]>
1 parent a037a1a commit 2443388

File tree

10 files changed

+1288
-224
lines changed

10 files changed

+1288
-224
lines changed

source/_includes/guides/owm-api-key-notice.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@
1717
<div class="alert alert--bg-purple alert--fg-white">
1818
<b>API KEY REQUIRED</b>
1919
<p>As of October 2015, an API key is required to fetch OpenWeatherMap data.
20-
These can be freely obtained from <a href="http://openweathermap.org/appid">OpenWeatherMap.org</a>.</p>
20+
These can be freely obtained from <a href="https://openweathermap.org">OpenWeatherMap.org</a>.</p>
2121
</div>

source/mobilenav.html

Lines changed: 10 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -26,45 +26,26 @@
2626
<li><a href="/tutorials/beginner/more-c/">More C Concepts</a></li>
2727
</ul>
2828
</li>
29-
<li><a href="/tutorials/watchface-tutorial/part1/">Create a C Watchface</a>
29+
<li><a href="/tutorials/watchface-tutorial/part1/">Build a Watchface in C</a>
3030
<ul>
31-
<li><a href="/tutorials/watchface-tutorial/part1/">Build Your Own Watchface</a></li>
32-
<li><a href="/tutorials/watchface-tutorial/part2/">Customize Your Watchface</a></li>
33-
<li><a href="/tutorials/watchface-tutorial/part3/">Adding Content From The Web</a></li>
31+
<li><a href="/tutorials/watchface-tutorial/part1/">Part 1 - Displaying the Time</a></li>
32+
<li><a href="/tutorials/watchface-tutorial/part2/">Part 2 - Customizing the Watchface</a></li>
33+
<li><a href="/tutorials/watchface-tutorial/part3/">Part 3 - Adding Web Content</a></li>
34+
<li><a href="/tutorials/watchface-tutorial/part4/">Part 4 - Adding a Battery Bar</a></li>
35+
<li><a href="/tutorials/watchface-tutorial/part5/">Part 5 - Vibrate on Disconnect</a></li>
3436
</ul>
3537
</li>
36-
<li><a href="/tutorials/pebble-js-tutorial/part1/">Create a JS Watchapp</a>
38+
<li><a href="/tutorials/js-watchface-tutorial/part1/">Build a Watchface in JS</a>
3739
<ul>
38-
<li><a href="/tutorials/pebble-js-tutorial/part1/">Build A Watchapp with Pebble.js</a></li>
39-
<li><a href="/tutorials/pebble-js-tutorial/part2/">Expanded Weather Forecasts</a></li>
40-
<li><a href="/tutorials/pebble-js-tutorial/part3/">Adding More Details</a></li>
40+
<li><a href="/tutorials/js-watchface-tutorial/part1/">Part 1 - Displaying the Time</a></li>
41+
<li><a href="/tutorials/js-watchface-tutorial/part2/">Part 2 - Adding Web Content</a></li>
4142
</ul>
4243
</li>
43-
<li><a href="/tutorials/intermediate/">Add More Features</a>
44-
<ul>
45-
<li><a href="/tutorials/intermediate/add-date/">Add a Date View</a></li>
46-
<li><a href="/tutorials/intermediate/add-date/">Add a Battery Meter</a></li>
47-
<li><a href="/tutorials/intermediate/add-date/">Add Connection Alerts</a></li>
48-
</ul>
49-
</li>
50-
<li><a href="/tutorials/advanced/">Go Beyond</a>
44+
<li><a href="/tutorials/advanced/">Advanced Tutorials</a>
5145
<ul>
5246
<li><a href="/tutorials/advanced/vector-animations/">Vector Animations</a></li>
5347
</ul>
5448
</li>
55-
<li><a href="/tutorials/android-tutorial/">PebbleKit Android Tutorial</a>
56-
<ul>
57-
<li><a href="/tutorials/android-tutorial/part1/">Integrating with Android</a></li>
58-
<li><a href="/tutorials/android-tutorial/part2/">Controlling Apps From Pebble</a></li>
59-
<li><a href="/tutorials/android-tutorial/part3/">Rock, Paper, Scissors with Pebble</a></li>
60-
</ul>
61-
<li><a href="/tutorials/ios-tutorial">PebbleKit iOS Tutorial</a>
62-
<ul>
63-
<li><a href="/tutorials/ios-tutorial/part1/">Integrating with iOS</a></li>
64-
<li><a href="/tutorials/ios-tutorial/part2/">Controlling Apps From Pebble</a></li>
65-
<li><a href="/tutorials/ios-tutorial/part3/">Rock, Paper, Scissors with Pebble</a></li>
66-
</ul>
67-
</li>
6849
</ul>
6950
</li>
7051
<li class="mobile-nav--sdk"><a href="/sdk/">Get the SDK</a></li>

source/tutorials/index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
<div class="vcenter">
3232
<h3>Build a Watchface</h3>
3333
<p>Learn how to create your first watchface. This tutorial will cover basic Pebble concepts, and is the recommended starting point for new developers.</p>
34-
<a href="/tutorials/js-watchface-tutorial/" target="_blank" class="btn btn--fg-green btn--bg-white">Build with JS</a>
35-
<a href="/tutorials/watchface-tutorial/" target="_blank" class="btn btn--fg-green btn--bg-white">Build with C</a>
34+
<a href="/tutorials/watchface-tutorial/part1" class="btn btn--fg-green btn--bg-white">Build with C</a>
35+
<a href="/tutorials/js-watchface-tutorial/part1" class="btn btn--fg-green btn--bg-white">Build with JS</a>
3636
</div>
3737
</div>
3838
</div>
@@ -48,7 +48,7 @@ <h3>Build a Watchface</h3>
4848
<div class="vcenter">
4949
<h3>Build a One Click Action</h3>
5050
<p>Learn how to create your first one click action watchapp. This guide explains how to create a watchapp that will makes a web request upon launch and display the result.</p>
51-
<a href="/guides/design-and-interaction/one-click-actions/" target="_blank" class="btn btn--fg-lightblue btn--bg-white">Build with C</a>
51+
<a href="/guides/design-and-interaction/one-click-actions/" class="btn btn--fg-lightblue btn--bg-white">Build with C</a>
5252
</div>
5353
</div>
5454
</div>
@@ -76,7 +76,7 @@ <h3>Learn C with Pebble</h3>
7676
<div class="vcenter">
7777
<h3>Publish Your App</h3>
7878
<p>Learn how to publish your watchface or watchapp on Pebble's appstore.</p>
79-
<a href="/guides/appstore-publishing/publishing-an-app" target="_blank" class="btn btn--fg-lightblue btn--bg-dawk">Publish an App</a>
79+
<a href="/guides/appstore-publishing/publishing-an-app" class="btn btn--fg-lightblue btn--bg-dawk">Publish an App</a>
8080
</div>
8181
</div>
8282
</div>

source/tutorials/js-watchface-tutorial/part1.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,14 @@ structure required for a basic Rocky.js application.
5858

5959
## Watchface Basics
6060

61-
Watchface are essentially long running applications that update the display at
61+
Watchfaces are essentially long running applications that update the display at
6262
a regular interval (typically once a minute, or when specific events occur). By
6363
minimizing the frequency that the screen is updated, we help to conserve
6464
battery life on the watch.
6565

6666
The main entry point for the watchface is `/src/rocky/index.js`, so we'll
67-
start by editing this file.
67+
start by editing this file. You can remove the sample content provided for the
68+
code given below.
6869

6970
The very first thing we must do is include the Rocky.js library, which gives us
7071
access to the APIs we need to create a Pebble watchface.
@@ -198,7 +199,9 @@ Another minute with your Pebble!
198199
```
199200

200201
> Note: You should prevent execution of the log statements by commenting the
201-
code, if you aren't using them. e.g. `//console.log();`
202+
> code, if you aren't using them. e.g. `// console.log();` before publishing the
203+
> watchface.
204+
202205

203206
## Creating an Analog Watchface
204207

@@ -221,7 +224,8 @@ representing the minute hand.
221224

222225
We need to implement a function to draw the hands, to prevent duplicating the
223226
same drawing code for hours and minutes. We're going to use a series of
224-
``CanvasRenderingContext2D`` methods to accomplish the desired effect.
227+
``CanvasRenderingContext2D`` methods to accomplish the desired effect in the
228+
`draw` callback we added earlier.
225229

226230
First we need to find the center point in our display:
227231

@@ -269,6 +273,9 @@ ctx.stroke();
269273

270274
### Putting It All Together
271275

276+
This is the complete code assembled so far, including a helpful function for
277+
drawing the hands and converting a time fraction to a Radian angle.
278+
272279
```js
273280
var rocky = require('rocky');
274281

@@ -421,8 +428,7 @@ output, it probably means there is an issue in the preceding code.
421428
### I'm still having problems!
422429

423430
If you've tried the steps above and you're still having problems, there are
424-
plenty of places to get help. You can post your question and code on the
425-
[Pebble Forums](https://forums.pebble.com/c/development) or join our
431+
plenty of places to get help. You can post your question and code on our
426432
[Discord Server]({{ site.links.discord_invite }}) and ask for assistance.
427433

428434

@@ -438,9 +444,7 @@ watchface using JavaScript! To do this we:
438444
5. Used drawing commands to draw text and lines on the display.
439445

440446
If you have problems with your code, check it against the sample source code
441-
provided using the button below.
442-
443-
[View Source Code >{center,bg-lightblue,fg-white}](https://github.com/pebble-examples/rocky-watchface-tutorial-part1)
447+
provided above.
444448

445449
## What's Next
446450

0 commit comments

Comments
 (0)