Lance-Rocket

Cette page contient des modifications qui ne sont pas marquées pour la traduction.

Auteur avatarM.Lance-Rocket | Dernière modification 18/04/2023 par M.Lance-Rocket

Vous réaliserez un lance-rocket bien évidemment dans un cadre pédagogique et non dans le but de blessé qui que ce soit.

Introduction

Voici le tuto pour réaliser votre propre "Lance-Rocket" éducatif.

Matériaux

Outils

Étape 1 - Modéliser le socle qui accueillera le canon

Modélisation sur solidworks




Étape 2 - Modéliser les cibles

Modélisation sur solidworks




Étape 3 - Graver nos modélisations

Grâce à une graveuse laser nous découpons nos modélisations sur du bois.

Étape 4 - création programme

on a fait un premier test sur le site Wokwi puis nous avant effectué le montage

code source :

from machine import Pin, I2C

import ssd1306

# ESP32 Pin assignment

i2c = I2C(0, scl=Pin(22), sda=Pin(21))

oled_width = 128

oled_height = 64

oled = ssd1306.SSD1306_I2C(oled_width, oled_height, i2c)

     

boutonR=Pin(15,Pin.IN)

bouton1=Pin(4,Pin.IN)

bouton2=Pin(5,Pin.IN)

bouton3=Pin(14,Pin.IN)

compteur =0

message= ''

appuyerbouton1 = 0

appuyerbouton2 = 0

appuyerbouton3 = 0

appuyerboutonR = 0

while True:

    if boutonR.value() == 0 and appuyerboutonR == 0:

        appuyerboutonR = 1

       

    elif boutonR.value() == 1 and appuyerboutonR == 1 :

        appuyerboutonR = 0

        compteur = 0

       

       

    if bouton1.value() == 0 and appuyerbouton1 == 0:

        appuyerbouton1 = 1

       

    elif bouton1.value() == 1 and appuyerbouton1 == 1 :

        appuyerbouton1 = 0

        compteur = compteur +1

       

       

    if bouton2.value() == 0 and appuyerbouton2 == 0:

        appuyerbouton2 = 1

       

    elif bouton2.value() == 1 and appuyerbouton2 == 1 :

        appuyerbouton2 = 0

        compteur = compteur +1

       

       

   

    if bouton3.value() == 0 and appuyerbouton3 == 0:

        appuyerbouton3 = 1

       

    elif bouton3.value() == 1 and appuyerbouton3 == 1 :

        appuyerbouton3 = 0

        compteur = compteur +1

    message= 'score '+ str(compteur)

    oled.fill(0)

    oled.text(message, 10, 30)

    oled.show()



Étape 5 - Création du support canon

nous avons crée un support pour le canon avec un roulement a bille pour amélioré la fluidité



Commentaires

Draft