Modifications

Sauter à la navigation Sauter à la recherche
1 octet ajouté ,  14 mai 2014 à 06:51
Ligne 8 : Ligne 8 :  
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.
   −
Pin 1, which has the onboard red LED, is used as an indicator on which sensors are tripped. When the alarm is set (no alarms tripped), the LED does not blink. It blinks from 1 to 7 depending when sensors are tripped (1 for #1/PIR, 2 for #2, 3 for #3, 4 for 1 and 2, 5 for 1 and 3, 6 for 2 and 3, and 7 for all sensors tripped). If you decide to use Pin 1 for other purposes, you can do so but with the LED in-circuit it can be tricky. For example, the internal pullup resistor, if enabled, is too weak. You may use a fairly low value external pullup resistor like in the hundreds of ohms if you decide to use the pin for sensors.}}
+
Pin 1, which has the onboard red LED, is used as an indicator on which sensors are tripped. When the alarm is set (no alarms tripped), the LED does not blink. It blinks from 1 to 7 depending when sensors are tripped (1 for #1/PIR, 2 for #2, 3 for #3, 4 for 1 and 2, 5 for 1 and 3, 6 for 2 and 3, and 7 for all sensors tripped). If you decide to use Pin 1 for other purposes, you can do so but with the LED in-circuit it can be tricky. For example, the internal pullup resistor, if enabled, is too weak. You may use a fairly low value external pullup resistor like in the hundreds of ohms if you decide to use the pin for sensors.
    
In the code for the example build, enabling DEBUG (uncommenting the line //#define DEBUG by deleting the // characters) will output the alarm values for the analog pin to the serial connection. You should do this once your circuit is together to ensure the values read by your circuit gives values understood by the code as alarms are set off.
 
In the code for the example build, enabling DEBUG (uncommenting the line //#define DEBUG by deleting the // characters) will output the alarm values for the analog pin to the serial connection. You should do this once your circuit is together to ensure the values read by your circuit gives values understood by the code as alarms are set off.
   −
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. }}
    
  <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