Skip to content

Commit d75de07

Browse files
Improve font appearance in Circuit 4C
1 parent 947f164 commit d75de07

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

content/SIK_Project4_CircuitC_Full.ipynb

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@
160160
"outputs": [],
161161
"source": [
162162
"# The below \"save\" comment is a SparkFun Jupyter Notebook command to save all code below to the board permanently\n",
163-
"# %save% \n",
163+
"# %save%\n",
164164
"\n",
165165
"# The qwiic_oled driver module allows for control of SparkFun OLEDs.\n",
166166
"# The QwiicLargeOled class is for the Large 1.3\" OLED display in our SIK\n",
@@ -232,6 +232,7 @@
232232
" myOLED.clear(myOLED.PAGE) # Clear the processor's display buffer.\n",
233233
"\n",
234234
"def show_start_sequence():\n",
235+
" myOLED.set_font_type(1) # Set our font to font #1 (medium sized letters and numbers)\n",
235236
" clear_all_oled() # Clear the OLED display\n",
236237
" myOLED.set_cursor(0, 0) # Move the cursor to the top left corner\n",
237238
" myOLED.print(\"Category:\") # Print \"Category:\"\n",
@@ -244,20 +245,26 @@
244245
" sleep_ms(2000) # Wait for 2 seconds\n",
245246
" \n",
246247
" clear_all_oled() # Clear the display\n",
247-
" myOLED.set_cursor(40, 20) # Move the cursor to middle(ish) of the screen\n",
248+
" myOLED.set_cursor(20, 25) # Move the cursor to middle(ish) of the screen\n",
248249
" myOLED.print(\"Get ready!\") # Print \"Get ready!\"\n",
249250
" myOLED.display() # Actually show what we've printed\n",
250251
" sleep_ms(1000) # Wait for 1 second\n",
252+
"\n",
253+
" # Let's make our countdown nice and big by using font #3 (Large Number Font)\n",
254+
" myOLED.set_font_type(3)\n",
251255
" \n",
252256
" # Pro Tip: You can count DOWN with a for loop by passing -1 to the range function\n",
253257
" # This will count from 3 to 1, decreasing by 1 each time\n",
254258
" for i in range(3, 0, -1): # Countdown from 3 to 1\n",
255259
" clear_all_oled() # Clear the display\n",
256-
" myOLED.set_cursor(40, 20) # Move the cursor to middle(ish) of the screen\n",
260+
" myOLED.set_cursor(60, 10) # Move the cursor to middle(ish) of the screen\n",
257261
" myOLED.print(str(i)) # Print the countdown number\n",
258262
" myOLED.display() # Actually show what we've printed\n",
259263
" sleep_ms(1000) # Wait for 1 second\n",
260264
"\n",
265+
" # # Set our font back to font #1 (medium sized letters and numbers) after the countdown\n",
266+
" myOLED.set_font_type(1)\n",
267+
"\n",
261268
"# Function to display when the player loses\n",
262269
"def game_over():\n",
263270
" clear_all_oled() # Clear the OLED display\n",
@@ -285,7 +292,7 @@
285292
" myOLED.set_cursor(50, 20) # Move the cursor to the top center of the screen\n",
286293
" myOLED.print(\"YOU\") # Print \"You\"\n",
287294
" \n",
288-
" myOLED.set_cursor(50, 30) # Move to the bottom center of the screen\n",
295+
" myOLED.set_cursor(50, 40) # Move to the bottom center of the screen\n",
289296
" myOLED.print(\"WIN!\") # Print \"WIN!\"\n",
290297
" myOLED.display() # Actually show what we've printed\n",
291298
" \n",
@@ -318,7 +325,7 @@
318325
"for i in range(len(orderOfWords)):\n",
319326
" clear_all_oled() # Clear the OLED display\n",
320327
"\n",
321-
" myOLED.set_cursor(40, 20) # Move the cursor to middle(ish) of the screen\n",
328+
" myOLED.set_cursor(0, 25) # Move the cursor to the start of the middle(ish) row of the screen\n",
322329
" roundNumber = i + 1 # the array starts at 0, but the roundNumber will start counting from 1\n",
323330
" myOLED.print(str(roundNumber) + \": \") # Print the current round number\n",
324331
" myOLED.print(words[orderOfWords[i]]) # Print the word from the random order list\n",

0 commit comments

Comments
 (0)