# Pedometer

![](https://2169521322-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fpakronics-education%2F-Lpg0r0jyU3XQdgAmqp8%2F-LpgALBn5yEyTx-PMEXs%2F0.png?generation=1569477977527136\&alt=media)

**Program HaloCode**

1\. Create 3 pieces of message: "start", "move", and "stop"

![](https://2169521322-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fpakronics-education%2F-Lpg0r0jyU3XQdgAmqp8%2F-LpgALBo0bsEX2rFM0c4%2F1.gif?generation=1569477977539991\&alt=media)

2\. Add an Events block when button is pressed , a Control block repeat, another Events block broadcast (start), and a Sensing block reset timer

![](https://2169521322-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fpakronics-education%2F-Lpg0r0jyU3XQdgAmqp8%2F-LpgALBpzGSIJAltkoNE%2F2.gif?generation=1569477977526859\&alt=media)

3\. Add a Control block if () else (), an Operators block () > (), a Sensing block shaking strength, and an Events block broadcast (move). Input "15" to the second box of the Operators block

![](https://2169521322-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fpakronics-education%2F-Lpg0r0jyU3XQdgAmqp8%2F-LpgALBquytXulVd-Z8N%2F3.gif?generation=1569477977528067\&alt=media)

4\. Add a Control block if () then (), an Operators block () = (), a Sensing block shaking strength, and an Events block broadcast (stop)

![](https://2169521322-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fpakronics-education%2F-Lpg0r0jyU3XQdgAmqp8%2F-LpgALBrfw2A6qqaw6b9%2F4.gif?generation=1569477977582590\&alt=media)

5\. Add a Control block repeat until (), an Operators block () > (), and a Sensing block timer. Input "100" to the second box of the Operators block, and combine the two scripts

![](https://2169521322-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fpakronics-education%2F-Lpg0r0jyU3XQdgAmqp8%2F-LpgALBsWOv2LhJNJUpz%2F5.gif?generation=1569477977562663\&alt=media)

**Add a sprite**

6\. Delete default sprite Panda

![](https://2169521322-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fpakronics-education%2F-Lpg0r0jyU3XQdgAmqp8%2F-LpgALBty5Jd2WWM-QcO%2F6.gif?generation=1569477977512425\&alt=media)

7\. Add sprite "Empty"

![](https://2169521322-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fpakronics-education%2F-Lpg0r0jyU3XQdgAmqp8%2F-LpgALBu7P-A4IhfoVq_%2F7.gif?generation=1569477977514371\&alt=media)

8\. Choose "Empty", and then click "Costume". Draw a red dot

![](https://2169521322-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fpakronics-education%2F-Lpg0r0jyU3XQdgAmqp8%2F-LpgALBv8hy1vU6ZvaZ-%2F8.gif?generation=1569477977545157\&alt=media)

9\. Duplicate "Empty", and then change the costume to make a blue dot

![](https://2169521322-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fpakronics-education%2F-Lpg0r0jyU3XQdgAmqp8%2F-LpgALBwzZ8R67TNBe5K%2F9.gif?generation=1569477977550253\&alt=media)

10\. At the bottom of the Blocks Area, click "+ extension" to add Pen

![](https://2169521322-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fpakronics-education%2F-Lpg0r0jyU3XQdgAmqp8%2F-LpgALBxOc8TLU_-Uhjh%2F10.gif?generation=1569477977571423\&alt=media)

**Program the red dot**

11\. Make sure the red dot is selected, and then click Variables blocks. Create a new variable "motion value"

![](https://2169521322-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fpakronics-education%2F-Lpg0r0jyU3XQdgAmqp8%2F-LpgALByQmbDhxzU8qO4%2F11.gif?generation=1569477977562395\&alt=media)

12\. Add an Events block when I receive (move), and a Control block repeat () times. Input "4"

![](https://2169521322-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fpakronics-education%2F-Lpg0r0jyU3XQdgAmqp8%2F-LpgALBzmLPmgWP99zBA%2F12.gif?generation=1569477977550058\&alt=media)

13\. Add a Motion block turn ↷ () degrees , and a Pen block stamp, and a Variables block change (Motion value) by (1)

![](https://2169521322-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fpakronics-education%2F-Lpg0r0jyU3XQdgAmqp8%2F-LpgALC-vDOaN5aRnZuU%2F13.gif?generation=1569477977598084\&alt=media)

14\. Add an Events block when I receive (start), and a Motion block point in direct (90)

![](https://2169521322-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fpakronics-education%2F-Lpg0r0jyU3XQdgAmqp8%2F-LpgALC05BTx54zIpYvQ%2F14.gif?generation=1569477977597103\&alt=media)

**Program the blue dot**

15\. Make sure the red dot is selected, and then click Variables blocks. Create a new variable "Slitting value"

![](https://2169521322-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fpakronics-education%2F-Lpg0r0jyU3XQdgAmqp8%2F-LpgALC1RU_NUfer6u4-%2F15.gif?generation=1569477977584727\&alt=media)

16\. Add an Events block when I receive (stop), and a Control block repeat () times. Input "2"

![](https://2169521322-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fpakronics-education%2F-Lpg0r0jyU3XQdgAmqp8%2F-LpgALC2IbmL730huRYK%2F16.gif?generation=1569477977597236\&alt=media)

17\. Add a Motion block turn ↷ () degrees , and a Pen block stamp, and a Variables block change (Slitting value) by (1)

![](https://2169521322-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fpakronics-education%2F-Lpg0r0jyU3XQdgAmqp8%2F-LpgALC3NznIwH9ANtg3%2F17.gif?generation=1569477977597061\&alt=media)

18\. Add an Events block when I receive (start), and a Motion block point in direct (90)

![](https://2169521322-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fpakronics-education%2F-Lpg0r0jyU3XQdgAmqp8%2F-LpgALC4QaqvAbyS2EwG%2F18.gif?generation=1569477977559269\&alt=media)
