From 894d37912dbe5c2e3d37067d220b4d6a57502ca6 Mon Sep 17 00:00:00 2001 From: thr1lls <152335578+thr1lls@users.noreply.github.com> Date: Tue, 28 Nov 2023 16:36:05 -0500 Subject: [PATCH 1/4] Create Poll Controller Tutorial A tutorial to create the poll controllers to send data to the Poll Radio Dashboard. --- docs/projects/Poll Controller Tutorial | 46 ++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 docs/projects/Poll Controller Tutorial diff --git a/docs/projects/Poll Controller Tutorial b/docs/projects/Poll Controller Tutorial new file mode 100644 index 00000000000..0817550e4dd --- /dev/null +++ b/docs/projects/Poll Controller Tutorial @@ -0,0 +1,46 @@ +# Poll Controller + +## Step 1 +We want to send a signal from one micro:bit to another using the radio function. +Drag ``||radio:radio set group||`` into ``||basic:on start||``. +Change the radio set group number to 4. +Delete the ``||basic:forever||`` block by dragging it onto the toolbox on the left side of the workspace until a garbage icon appears. + +## Step 2 +We need to let the receiving micro:bit identify who they are receiving data from. +Drag ``||radio:radio set transmit serial number||`` into ``||basic:on start||``. +Ensure it is set to "true". + +## Step 3 +Now we want the micro:bit to continuously transmit this data. +Drag ``||loops:every (500)ms||`` onto the workspace and set it to 40000ms. +Drag ``||radio:radio set transmit serial number||`` into ``||loops:every (40000)ms||``. +## Step 4 +Now let's setup what our buttons will do. +Drag ``||input:on button [A] pressed||`` onto the workspace. +We need the button to trigger a radio signal. +Drag ``||radio:radio send string []||`` into ``||input:on button [A] pressed||`` and set it to "A". + +## Step 5 +We want our LED array to reflect our button press. +Drag ``||basic:show leds||`` into ``||input:on button [A] pressed||`` under ``||radio:radio send string [A]||``. +Select the leds you want it to show to represent the letter "A". + +## Step 6 +Now repeat steps 4 and 5, changing ``||input:on button [A] pressed||`` to "B" and ``||basic:show leds||`` to represent the letter "B". + +## Step 7 +Drag ``||input:on logo [pressed]||`` onto the workspace. +Drag ``||radio:radio send string []||`` into ``||input:on logo [pressed]||`` and set it to "C". +Drag ``||basic:show leds||`` underneath ``||radio:radio send string [C]||`` and select the leds to represent the letter "C". + +## Step 8 +Our final trigger will be a "reset" using the shake function. +Drag ``||input:on [shake]||`` onto the workspace. +Drag ``||radio:radio send string []||`` into ``||input:on [shake]||`` and set it to "D". +Drag ``||basic:show icon []||`` underneath ``||radio:radio send string [D]||`` and select the icon of your choice. + +## Step 9 +Connect your micro:bit and click "Download" to install the program. + +Go to https://github.com/thr1lls/pxt-microbit/blob/537d29efd979275e6c9340359c97d326893b6004/docs/projects/Poll%20Radio%20Dashboard for code to setup receiver micro:bit. From 33cbbbbc340ec886b943cd5925213cbea09c5b23 Mon Sep 17 00:00:00 2001 From: thr1lls <152335578+thr1lls@users.noreply.github.com> Date: Wed, 29 Nov 2023 11:23:22 -0500 Subject: [PATCH 2/4] Update Poll Controller Tutorial updated a bit of the language, added headings for each step --- docs/projects/Poll Controller Tutorial | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/docs/projects/Poll Controller Tutorial b/docs/projects/Poll Controller Tutorial index 0817550e4dd..63b958e128e 100644 --- a/docs/projects/Poll Controller Tutorial +++ b/docs/projects/Poll Controller Tutorial @@ -1,46 +1,47 @@ # Poll Controller -## Step 1 +## Step 1: Setup radio signal We want to send a signal from one micro:bit to another using the radio function. Drag ``||radio:radio set group||`` into ``||basic:on start||``. Change the radio set group number to 4. Delete the ``||basic:forever||`` block by dragging it onto the toolbox on the left side of the workspace until a garbage icon appears. -## Step 2 +## Step 2: Identify our micro:bit We need to let the receiving micro:bit identify who they are receiving data from. Drag ``||radio:radio set transmit serial number||`` into ``||basic:on start||``. Ensure it is set to "true". -## Step 3 -Now we want the micro:bit to continuously transmit this data. +## Step 3: Maintain the radio connection +Now we want the micro:bit to continuously transmit this data to maintain the connection. Drag ``||loops:every (500)ms||`` onto the workspace and set it to 40000ms. Drag ``||radio:radio set transmit serial number||`` into ``||loops:every (40000)ms||``. -## Step 4 + +## Step 4: Setup a button Now let's setup what our buttons will do. Drag ``||input:on button [A] pressed||`` onto the workspace. We need the button to trigger a radio signal. Drag ``||radio:radio send string []||`` into ``||input:on button [A] pressed||`` and set it to "A". -## Step 5 +## Step 5: Create a led icon We want our LED array to reflect our button press. Drag ``||basic:show leds||`` into ``||input:on button [A] pressed||`` under ``||radio:radio send string [A]||``. Select the leds you want it to show to represent the letter "A". -## Step 6 +## Step 6: Setup the next button Now repeat steps 4 and 5, changing ``||input:on button [A] pressed||`` to "B" and ``||basic:show leds||`` to represent the letter "B". -## Step 7 +## Step 7: Setup the third button Drag ``||input:on logo [pressed]||`` onto the workspace. Drag ``||radio:radio send string []||`` into ``||input:on logo [pressed]||`` and set it to "C". Drag ``||basic:show leds||`` underneath ``||radio:radio send string [C]||`` and select the leds to represent the letter "C". -## Step 8 +## Step 8: Setup the final "button" Our final trigger will be a "reset" using the shake function. Drag ``||input:on [shake]||`` onto the workspace. Drag ``||radio:radio send string []||`` into ``||input:on [shake]||`` and set it to "D". Drag ``||basic:show icon []||`` underneath ``||radio:radio send string [D]||`` and select the icon of your choice. -## Step 9 +## Step 9: Finalize Connect your micro:bit and click "Download" to install the program. -Go to https://github.com/thr1lls/pxt-microbit/blob/537d29efd979275e6c9340359c97d326893b6004/docs/projects/Poll%20Radio%20Dashboard for code to setup receiver micro:bit. +Go to https://github.com/thr1lls/pxt-microbit/blob/537d29efd979275e6c9340359c97d326893b6004/docs/projects/Poll%20Radio%20Dashboard for code to setup the receiver micro:bit. From 4a65ba807d51a4917f810fe4b476397a415c8705 Mon Sep 17 00:00:00 2001 From: thr1lls <152335578+thr1lls@users.noreply.github.com> Date: Wed, 29 Nov 2023 16:30:18 -0500 Subject: [PATCH 3/4] Update Poll Controller Tutorial needed to add a radio send number to the shake function. --- docs/projects/Poll Controller Tutorial | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/projects/Poll Controller Tutorial b/docs/projects/Poll Controller Tutorial index 63b958e128e..d015dd3bd9a 100644 --- a/docs/projects/Poll Controller Tutorial +++ b/docs/projects/Poll Controller Tutorial @@ -38,6 +38,7 @@ Drag ``||basic:show leds||`` underneath ``||radio:radio send string [C]||`` and ## Step 8: Setup the final "button" Our final trigger will be a "reset" using the shake function. Drag ``||input:on [shake]||`` onto the workspace. +Drag ``||radio:radio send number []||`` into ``||input:on [shake]||`` and set it to 35. Drag ``||radio:radio send string []||`` into ``||input:on [shake]||`` and set it to "D". Drag ``||basic:show icon []||`` underneath ``||radio:radio send string [D]||`` and select the icon of your choice. From 286a198d666a9940cefa9d55bc9fc9ba47c245bd Mon Sep 17 00:00:00 2001 From: thr1lls <152335578+thr1lls@users.noreply.github.com> Date: Fri, 1 Dec 2023 11:26:36 -0500 Subject: [PATCH 4/4] Update Poll Controller Tutorial fixed the link at the end and a continual ping with radio send number block in step 3 --- docs/projects/Poll Controller Tutorial | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/projects/Poll Controller Tutorial b/docs/projects/Poll Controller Tutorial index d015dd3bd9a..4cfc9e6053a 100644 --- a/docs/projects/Poll Controller Tutorial +++ b/docs/projects/Poll Controller Tutorial @@ -13,8 +13,8 @@ Ensure it is set to "true". ## Step 3: Maintain the radio connection Now we want the micro:bit to continuously transmit this data to maintain the connection. -Drag ``||loops:every (500)ms||`` onto the workspace and set it to 40000ms. -Drag ``||radio:radio set transmit serial number||`` into ``||loops:every (40000)ms||``. +Drag ``||loops:every (500)ms||`` onto the workspace and set it to 5000ms. +Drag ``||radio:radio send number []||`` into ``||loops:every (5000)ms||`` and set it to 35. ## Step 4: Setup a button Now let's setup what our buttons will do. @@ -45,4 +45,4 @@ Drag ``||basic:show icon []||`` underneath ``||radio:radio send string [D]||`` a ## Step 9: Finalize Connect your micro:bit and click "Download" to install the program. -Go to https://github.com/thr1lls/pxt-microbit/blob/537d29efd979275e6c9340359c97d326893b6004/docs/projects/Poll%20Radio%20Dashboard for code to setup the receiver micro:bit. +Go to https://github.com/thr1lls/pxt-microbit/blob/f19750f72bc2abb94eed7d51ba5707aba9cf69bb/docs/projects/Poll%20Radio%20Dashboard for code to setup the receiver micro:bit.