@@ -240,6 +240,8 @@ def write_message(self, message, skip_spaces=True, step_size=6, delay=0.02):
240240 # loop over the words in the message
241241 for index , word in enumerate (message_words ):
242242 print (f"index: { index } , word: { word } " )
243+ # send it to lowercase to get rid of capital letters
244+ word = word .lower ()
243245
244246 # if the current word is one of the full words on the board
245247 if word in SpiritBoard .FULL_WORDS :
@@ -269,12 +271,17 @@ def write_message(self, message, skip_spaces=True, step_size=6, delay=0.02):
269271
270272 # loop over each character in the word
271273 for character in word :
272- # slide the planchette to the current characters location
273- self .slide_planchette (SpiritBoard .LOCATIONS [character ],
274- delay = delay , step_size = step_size )
275-
276- # pause after we arrive
277- time .sleep (0.5 )
274+ # if the character is in our locations mapping
275+ if character in SpiritBoard .LOCATIONS .keys ():
276+ # slide the planchette to the current characters location
277+ self .slide_planchette (SpiritBoard .LOCATIONS [character ],
278+ delay = delay , step_size = step_size )
279+
280+ # pause after we arrive
281+ time .sleep (0.5 )
282+ else :
283+ # character is not in our mapping
284+ print (f"Skipping '{ character } ', it's not on the board." )
278285
279286 # if we are not skipping spaces, and we are not done with the message
280287 if not skip_spaces and index < len (message_words ) - 1 :
0 commit comments