Skip to content

Commit 2bff9f0

Browse files
Add coding challenge and troubleshooting sections for all circuits
1 parent c4d3f55 commit 2bff9f0

16 files changed

+265
-3
lines changed

content/SIK_Project1_CircuitA_Full.ipynb

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,14 +268,31 @@
268268
"id": "d91669fb-aea7-411c-927b-99724540a33c",
269269
"metadata": {},
270270
"source": [
271-
"When this command runs, it blinks the LED 10 times by setting the LED high, then low and sleeping inbetween each step. "
271+
"## What You Should See\n",
272+
"\n",
273+
"When this command runs, it blinks the LED 10 times by setting the LED high, then low and sleeping in between each step. "
272274
]
273275
},
274276
{
275277
"cell_type": "markdown",
276-
"id": "10d5c3fe-852f-42f7-8378-85dc8c8c7c3e",
278+
"id": "67d5c010",
277279
"metadata": {},
278280
"source": [
281+
"## Coding Challenges\n",
282+
"\n",
283+
"| Challenge | Description |\n",
284+
"|------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n",
285+
"| Persistence of Vision | Computer screens, movies and the lights in your house all flicker so quickly that they appear to be on all of the time but are actually blinking faster than the human eye can detect. See how much you can decrease the delay time in your program before the light appears to be on all the time but is still blinking. |\n",
286+
"| Morse Code | Try changing the delays and adding more `led_pin.high()` and `led_pin.low()` commands to make your program blink a message in Morse code. |\n",
287+
"\n",
288+
"## Troubleshooting\n",
289+
"\n",
290+
"| Problem | Solution |\n",
291+
"|-----------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n",
292+
"| I get an error when uploading my code | Make sure you are connected to the correct serial port and have run all of the code cells in order in this Notebook. You can also try clicking the \"Restart kernel and run all cells\" button at the top of the page (⏩). This will make sure to run every cell and run them in order. Which Serial Port is the right one? Depending on how many devices you have plugged into your computer, you may have several active Serial Ports. A simple way to determine the correct one is to look at your list of Serial Ports. Unplug your RedBoard from your computer. Look at the list again. Whichever Serial Port has disappeared from the list is the one you want to select once you plug your board back in to your computer. |\n",
293+
"| My code uploads, but my LED won’t turn on | LEDs will only work in one direction. Try taking it out of your breadboard, turning it 180 degrees, and reinserting it. |\n",
294+
"| Still not working? | Jumper wires unfortunately can go \"bad\" from getting bent too much. The copper wire inside can break, leaving an open connection in your circuit. If you are certain that your circuit is wired correctly and that your code is error-free and uploaded but you are still encountering issues, try replacing one or more of the jumper wires for the component that is not working. |\n",
295+
"\n",
279296
"## You've Completed Circuit 1A!\n",
280297
"\n",
281298
"Continue to circuit 1B to learn about analog signals and potentiometers\n",

content/SIK_Project1_CircuitB_Full.ipynb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,19 @@
274274
"id": "10d5c3fe-852f-42f7-8378-85dc8c8c7c3e",
275275
"metadata": {},
276276
"source": [
277+
"## Coding Challenges\n",
278+
"\n",
279+
"| Challenge | Description |\n",
280+
"|----------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n",
281+
"| Changing the Range | Try multiplying, dividing or adding to your sensor reading so that you can change the range of the delay in your code. For example, can you multiply the sensor reading so that the delay goes from 0–2046 instead of 0–65535? |\n",
282+
"| Adding More LEDs | Add more LEDs to your circuit. Don't forget the current limiting resistor for each one. Try making multiple LEDs blink at different rates by changing the range of each using multiplication or division. |\n",
283+
"\n",
284+
"## Troubleshooting\n",
285+
"| Problem | Solution |\n",
286+
"|-------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n",
287+
"| The potentiometer always reads as 0 or 65535. | Make sure that your 5V, A0 and GND pins are properly connected to the three pins on your potentiometer. It is easy to misalign a wire with the actual trimpot pin. |\n",
288+
"| No values printed | Make sure you are connected to the correct serial port and have run all of the code cells in order in this Notebook. You can also try clicking the \"Restart kernel and run all cells\" button at the top of the page (⏩). |\n",
289+
"\n",
277290
"## You've Completed Circuit 1B!\n",
278291
"\n",
279292
"Continue to circuit 1C to learn about photoresistors\n",

content/SIK_Project1_CircuitC_Full.ipynb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,18 @@
262262
"id": "10d5c3fe-852f-42f7-8378-85dc8c8c7c3e",
263263
"metadata": {},
264264
"source": [
265+
"## Coding Challenges\n",
266+
"Challenge | Description\n",
267+
"--- | ---\n",
268+
"Response Pattern | Right now your `if` statement turns the LED on when it gets dark, but you can also use the light sensor like a no-touch button. Try using `low()`, `high()` and `sleep()` to make the LED blink a pattern when the light level drops, then calibrate the threshold variable in the code so that the blink pattern triggers when you wave your hand over the sensor.\n",
269+
"Replace Photoresistor's 330Ω Resistor with LED. | Alter the circuit be replacing the 330Ω resistor with an LED (the negative leg should connect to GND). Now what happens when you place your finger over the photoresistor? This is a great way to see Ohm's law in action by visualizing the change in resistance's affect on the current flowing through the LED.\n",
270+
"\n",
271+
"## Troubleshooting\n",
272+
"| Problem | Solution |\n",
273+
"| --- | --- |\n",
274+
"| The light never turns on or always stays on | Look at the value that the photoresistor is reading in a bright room (e.g., 915). Cover the photoresistor, or turn the lights off. Then look at the new value that the photoresistor is reading (e.g., 550). Set the threshold in between these two numbers (e.g., 700) so that the reading is above the threshold when the lights are on and below the threshold when the lights are off. |\n",
275+
"| Nothing is printing. | Try unplugging your USB cable and plugging it back in. Make sure you are connected to the correct serial port and have run all of the code cells in order in this Notebook. You can also try clicking the \"Restart kernel and run all cells\" button at the top of the page (⏩). |\n",
276+
"\n",
265277
"## You've Completed Circuit 1C!\n",
266278
"\n",
267279
"Continue to circuit 1D to learn about RGB LEDs\n",

content/SIK_Project1_CircuitD_Full.ipynb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,21 @@
413413
"source": [
414414
"## You've Completed Circuit 1D!\n",
415415
"\n",
416+
"## Coding Challenges\n",
417+
"| Challenge | Description |\n",
418+
"|----------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n",
419+
"| Add more colors | You can create many more colors with the RGB LED. Use the `duty_u16()` function to blend different values of red, green and blue together to make even more colors. You can divide the potentiometer value up more and make more nested if statements so that you can have more colors as you twist the knob. |\n",
420+
"| Multi color blink | Try using delays and multiple color functions to have your RGB LED change between multiple colors. |\n",
421+
"| Change the threshold | Try setting your threshold variable by reading the value of a potentiometer with `read_u16()`. By turning the potentiometer, you can then change the threshold level and adjust your night-light for different rooms. |\n",
422+
"| Fading the LED | Try using a loop with the `duty_u16()` to get your LED to pulse gently or smoothly transition between colors. |\n",
423+
"\n",
424+
"## Troubleshooting\n",
425+
"| Problem | Solution |\n",
426+
"|------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n",
427+
"| The LED never turns on or off | Make sure that your photoresistor is returning values between 0 and 65535. Try covering the photoresistor; the values should change. If they do not change, check the wiring of the photoresistor. If your photoresistor is working correctly, make sure that your threshold variable sits in between the value that the photoresistor reads when it is bright and the value that the photoresistor reads when it is dark (e.g., bright = 850, dark = 600, threshold = 700). |\n",
428+
"| My LED doesn’t show the colors that I expect | Make sure that all three of the pins driving your RGB LED are set to OUTPUT. Then make sure that each LED is wired properly. |\n",
429+
"| Nothing is printing. | Try unplugging your USB cable and plugging it back in. Make sure you are connected to the correct serial port and have run all of the code cells in order in this Notebook. You can also try clicking the \"Restart kernel and run all cells\" button at the top of the page (⏩). |\n",
430+
"\n",
416431
"## You've Also Completed all of Project 1!\n",
417432
"\n",
418433
"Get ready to have some fun with sound in project 2.\n",

content/SIK_Project2_CircuitA_Full.ipynb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,21 @@
256256
"## What You Should See\n",
257257
"When the program begins, a song will play from the buzzer once. Use the potentiometer to adjust the volume.\n",
258258
"\n",
259+
"## Coding Challenges\n",
260+
"\n",
261+
"| Challenge | Description |\n",
262+
"|----------------------------|----------------------------------------------------------------------------------------------|\n",
263+
"| Change the tempo of the song | Experiment with the `beatLength` variable to change the tempo of the song. |\n",
264+
"| Make your own song | Try changing the notes to make a different song. Spaces `\" \"` can be used for rests in the song. |\n",
265+
"\n",
266+
"## Troubleshooting\n",
267+
"\n",
268+
"\n",
269+
"| Problem | Solution |\n",
270+
"|------------------------------- |--------------------------------------------------------------------------------------------|\n",
271+
"| The song is too quiet or too loud | Turn the potentiometer to adjust the volume. |\n",
272+
"| No sound is playing | Try pressing the reset button on the RedBoard. If that doesn’t work, check your wiring of the buzzer. It's easy to misalign a pin with a jumper wire. |\n",
273+
"\n",
259274
"## You've Completed Circuit 2A!\n",
260275
"\n",
261276
"Continue to circuit 2B to learn about buttons.\n",

content/SIK_Project2_CircuitB_Full.ipynb

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,17 +156,44 @@
156156
" pwmSpeaker.duty_u16(32768) # Set the duty cycle to 50% (half as loud as possible)\n",
157157
" else: # If no key is pressed\n",
158158
" pwmSpeaker.freq(0)\n",
159-
" pwmSpeaker.duty_u16(0) # turn off the speaker "
159+
" pwmSpeaker.duty_u16(0) # turn off the speaker \n",
160+
"\n",
161+
"# Frequency Table: Feel free to change the frequencies for each button press to play different notes.\n",
162+
"# note frequency\n",
163+
"# c 262 Hz\n",
164+
"# d 294 Hz\n",
165+
"# e 330 Hz\n",
166+
"# f 349 Hz\n",
167+
"# g 392 Hz\n",
168+
"# a 440 Hz\n",
169+
"# b 494 Hz\n",
170+
"# C 523 Hz"
160171
]
161172
},
162173
{
163174
"cell_type": "markdown",
164175
"id": "10d5c3fe-852f-42f7-8378-85dc8c8c7c3e",
165176
"metadata": {},
166177
"source": [
178+
"\n",
167179
"## What You Should See\n",
168180
"Different tones will play when you press different keys. Turning the potentiometer will adjust the volume.\n",
169181
"\n",
182+
"## Coding Challenges\n",
183+
"\n",
184+
"| Challenge | Description |\n",
185+
"|-----------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n",
186+
"| Change the key of each button | Use the frequency table in the comment section at the end of the code to change the notes that each button plays. |\n",
187+
"| Play more than three notes with if statements | By using combinations of buttons, you can play up to seven notes of the scale. You can do this in a few ways. To get more practice with if statements, try adding seven if statements and using the Boolean `and` operator to represent all of the combinations of keys. |\n",
188+
"| Play more than three notes with binary math | You can use a clever math equation to play more than three notes with your three keys. By multiplying each key by a different number, then adding up all of these numbers, you can make a math equation that produces a different number for each combination of keys. |\n",
189+
"\n",
190+
"## Troubleshooting \n",
191+
"| Problem | Solution |\n",
192+
"|------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------|\n",
193+
"| The buzzer is too loud or too quiet | Turn the potentiometer to adjust the volume. |\n",
194+
"| The RedBoard thinks one key is always pressed | Check your wiring. You may have ground and 5V backward if one or more buttons behave as though they're pressed all the time. |\n",
195+
"| The buttons are not working | First, make sure that the wiring is correct. It is easy to misalign a wire with a button leg. Second, make sure that you have declared your buttons as inputs and have enabled the internal pull-up resistors with `Pin.IN` and `Pin.PULL_UP` |\n",
196+
"\n",
170197
"## You've Completed Circuit 2B!\n",
171198
"\n",
172199
"Continue to circuit 2C to learn about for loops, measuring durations, and put together all you've learned in project 2.\n",

0 commit comments

Comments
 (0)