Modifications

Sauter à la navigation Sauter à la recherche
407 octets ajoutés ,  14 mai 2014 à 06:54
Ligne 2 : Ligne 2 :     
== Le code ==
 
== Le code ==
{{bloc-etroit|text=The code for a simple alarm with three sensors or branches is shown below.
+
{{bloc-etroit|text=Le code pour le simple système d'alarme est présenté ci-dessous.
   −
This configuration has the sensors tied into resistors feeding Pin 3. The Trinket must be programmed out of the circuit as pins 3 and 4 are shared with the USB.
+
Cette configuration utilise des senseurs liées à la broche 3 (analogique) par l'intermédiaire de résistances. Le Trinket doit être programmé débranché du montage puisque les broches 3 et 4 sont utilisée par le connecteur USB.
    
The program uses the standard Softwareserial library to talk via the Bluefruit EZ-Link on Pin 0 for transmit, Pin 2 for receive. You can eliminate the requirement to specify a receive pin (and shrink the code slightly) with the third party SendOnlySoftwareSerial library on arduino.cc via this forum thread: [http://forum.arduino.cc/index.php?topic=112013.0 http://forum.arduino.cc/index.php?topic=112013.0.].  This would also allow you to use Pin 2 (Analog 1) for alarms, freeing Pin 3 shared with USB.
 
The program uses the standard Softwareserial library to talk via the Bluefruit EZ-Link on Pin 0 for transmit, Pin 2 for receive. You can eliminate the requirement to specify a receive pin (and shrink the code slightly) with the third party SendOnlySoftwareSerial library on arduino.cc via this forum thread: [http://forum.arduino.cc/index.php?topic=112013.0 http://forum.arduino.cc/index.php?topic=112013.0.].  This would also allow you to use Pin 2 (Analog 1) for alarms, freeing Pin 3 shared with USB.
Ligne 13 : Ligne 13 :     
Trip each combination of sensors, record the value for the analog pin displayed on the serial line. Change the code line that has uint16_t values to the values you find. On the bench this process takes less than 5 minutes. If you have problems with the final install giving errors, try this process again as the resistance of the wiring may change the values. }}
 
Trip each combination of sensors, record the value for the analog pin displayed on the serial line. Change the code line that has uint16_t values to the values you find. On the bench this process takes less than 5 minutes. If you have problems with the final install giving errors, try this process again as the resistance of the wiring may change the values. }}
 +
 +
 +
{{ambox-stop|text=Assurez-vous d'avoir suivit [[Trinket|les instructions d'installation de la version Arduino IDE spéciale pour le Trinket]]. Si vous n'avez jamais programmé un Trinket, nous vous proposons de suivre notre [[Trinket|tutoriel Trinket]] car celui-ci se programme de façon un peu différente des autres cartes Arduino. }}
    
  <nowiki>/* Trinket Alarm Analog An alarm system based on the Adafruit Trinket mini microcontroller
 
  <nowiki>/* Trinket Alarm Analog An alarm system based on the Adafruit Trinket mini microcontroller
29 917

modifications

Menu de navigation