//Code en nbc pour la trompette //Code en msi2 par Éloïse Bisson #define DUREE 125 dseg segment var1 byte var2 byte var3 byte Piton byte dseg ends thread main SetSensorTouch(IN_1) SetSensorTouch(IN_2) SetSensorTouch(IN_3) Depart: set Piton,0 Contact1: ReadSensor(IN_1,var1) brcmp LT,Contact2,var1,1 add Piton,Piton,100 Contact2: ReadSensor(IN_2,var2),1 brcmp LT,Contact3,var2,1 add Piton,Piton,10 Contact3: ReadSensor(IN_3,var3) brcmp LT,Chek,var3,1 add Piton,Piton,1 Check: brcmp EQ, loopF,Piton,111 brcmp EQ, loopA,Piton,110 brcmp EQ, loopG,Piton,101 brcmp EQ, loopD,Piton,10 brcmp EQ, loopB,Piton,11 brcmp EQ, loopE,Piton,1 brcmp EQ, loopC,Piton,100 saut: jmp Contact1 loopC: TextOut(50,8,' Do ') PlayTone(TONE_C5,DUREE) Wait (DUREE) TextOut(50,8,' ') jmp Depart loopD: TextOut(50,8,' Re ') PlayTone(TONE_D5,DUREE) Wait (DUREE) TextOut(50,8,' ') jmp Depart loopE: TextOut(50,8,' Mi ') PlayTone(TONE_E5,DUREE) Wait (DUREE) TextOut(50,8,' ') jmp Depart loopF: TextOut(50,8,' Fa ') PlayTone(TONE_F5,DUREE) Wait (DUREE) TextOut(50,8,' ') jmp Depart loopG: TextOut(50,8,' Sol ') PlayTone(TONE_G5,DUREE) Wait (DUREE) TextOut(50,8,' ') jmp Depart loopA: TextOut(50,8,' La ') PlayTone(TONE_A3,DUREE) Wait (DUREE) TextOut(50,8,' ') jmp Depart loopB: TextOut(50,8,' Si ') PlayTone(TONE_B3,DUREE) Wait (DUREE) TextOut(50,8,' ') jmp Depart endt