Thymio helps with learning languages

This page presents an example of using the Thymio II robot to teach some expression, in this case English expressions about positioning.

Several positions (on the side, on the back…) have been associated with an audio description. The user needs to understand what Thymio II says and put him in the right position to make him "happy". The following video shows the resulting behaviour and the corresponding manipulation:

To obtain this behaviour the robot has to be programmed and equipped with a set of audio files stored on a microSD card inserted in the robot. The files to be placed in the SD card can be found in this ZIP archive. Just copy the contents of the ZIP archive to the SD card and program the robot with the following code:

var etat
 etat=0
 call sound.play(6)
onevent prox
if etat==0 then      # normal state

  when button.backward==1 do #want to be vertical
      call sound.play(17)
      call leds.top(0,0,32)
      etat=5
   end
   when  button.left==1 do #want to be on the left side
      call sound.play(11)
      call leds.top(0,32,32)
      etat=4
   end
   when button.right==1 do #want to be on the right side
      call sound.play(12)
      call leds.top(32,32,0)
      etat=3
   end
   when  button.forward==1 do #hide the eyes
      call sound.play(10)
      call leds.top(0,32,0)
      etat=2
   end
   when button.center==1 do #on the back
      call sound.play(2)
      call leds.top(32,0,0) 
      etat=1
   end
end

if etat==1 then #robot red, on the back
  when acc[2]<-19  do # back to normal state
    call sound.play(18)
    call leds.top(0,0,0)
    etat=0
  end
end

if  etat==2 then  #hide the eyes
   when prox.horizontal[0]>1 and   prox.horizontal[1]>1 and prox.horizontal[2]>1 
and prox.horizontal[3]>1 and prox.horizontal[4]>1 do  #back to normal state
      call sound.play(18)
      call leds.top(0,0,0)
      etat=0
    end
end

if  etat==3 then #right side
    when acc[0]<-18  do  #back to normal state
       call sound.play(8)
       call leds.top(0,0,0)
       etat=0
    end
end

if  etat==4 then #left side
    when acc[0]>22   do #back to normal state
       call sound.play(8)
       call leds.top(0,0,0)
       etat=0
    end
end

if  etat==5 then # vertical
    when acc[1]>19 do # back to normal state
       call sound.play(9)
       call leds.top(0,0,0)
       etat=0
    end
end
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License