March 7, 2015

Uniden "Ucontrol" Parts List

Parts List
Nano v3 $3.59
Breadboard 400 Contacts $1.94
Remote Control Module Kits $2.04
Serial DB9P Pin RS232 $4.19
MAX3232 RS232 Serial Port To TTL $1.00
40PCS Jumper Wire Cable $1.34
Total Price $15.00

 Alpha Version of the code is below. The Empty wires are for the serial to ttl converter hookup







  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
// Uniden UControl
// Version 1.0
// Support for Arduino 1.6
//
//Copyright (c) 2015 Michael Ladd & Richard Kot
//
//Permission is hereby granted, free of charge, to any person obtaining a copy
//of this software and associated documentation files (the "Software"), to deal
//in the Software without restriction, including without limitation the rights
//to use, copy, modify, merge, publish, and/or distribute, sublicense
//copies of the Software, and to permit persons to whom the Software is
//furnished to do so, subject to the following conditions:
//
//The above copyright notice and this permission notice shall be included in
//all copies or substantial portions of the Software.
//
//Our name be included as original author within this notice.
//
//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
//THE SOFTWARE.


//Disclaimer: Richard Kot and Michael Ladd /or this site are not responsible for any damage
//(e.g. Personal, environmental, property...) that may occur from
//any circuits or their variations found on this site.

//===============================================================================
// This sketch has been tested on a Uniden 996T scanner but
// should work on other Uniden scanners that utilize the same
// remote commands. Please use this space to add other scanner that
// respond to these commands.
//
// Your milage may vary.

#include <IRremote.h> // Library call for IR
int RECV_PIN = 11; // the pin where you connect the output pin of TSOP4838

int itsON[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; //zero out everything


#define code1  8925 // Scan Up
#define code2  4845 // Scan Down
#define code3  24735 // Hold Resume
#define code4  36975 // GROUP 1
#define code5  41055 // GROUP 2
#define code6  32895 // GROUP 3
#define code7  53805 // GROUP 4
#define code8  57885 // GROUP 5
#define code9  49725 // GROUP 6
#define code10 21165// GROUP 7
#define code11 25245// GROUP 8 
#define code12 17085// GROUP 9 
#define code13 41565// GROUP 0

IRrecv irrecv(RECV_PIN); // Part of the IR Library
decode_results results; //Part of the IR Library

void setup()

{
  Serial.begin(115200);   // you can comment this line
  irrecv.enableIRIn();  // Start the receiver
}
void loop() {
  if (irrecv.decode(&results)) {
    unsigned int value = results.value;
    switch (value) {


      case code1:
        if (itsON[1] == 1) {       // if first led is on then
          Serial.flush();
          Serial.print("KEY,>,P");
                   itsON[1] = 0;           // and set its state as off
               } else {                      // else if first led is off
          itsON[1] = 1;          // and set its state as on
        }
        break;


      case code2:
        if (itsON[2] == 1) {
          Serial.flush();
          Serial.print("KEY,<,P");
                    itsON[2] = 0;
                 } else {
          itsON[2] = 1;
        }
        break;


      case code3:
        if (itsON[3] == 1) {
          Serial.flush();
          Serial.print("KEY,H,P");
                   itsON[3] = 0;
                  } else {
          itsON[3] = 1;
        }
        break;


      case code4:
        if (itsON[4] == 1) {

          Serial.flush();
          Serial.print("KEY,1,L");
itsON[4] = 0;
                  } else {
          itsON[4] = 1;
        }
        break;


      case code5:
        if (itsON[5] == 1) {
          Serial.flush();
          Serial.print("KEY,2,L");
                    itsON[5] = 0;
                  } else {
          itsON[5] = 1;
        }
        break;


      case code6:
        if (itsON[6] == 1) {
          Serial.flush();
          Serial.print("KEY,3,L");
                    itsON[6] = 0;
                  } else {
          itsON[6] = 1;
        }
        break;


      case code7:
        if (itsON[7] == 1) {
          Serial.flush();
          Serial.print("KEY,4,L");
                   itsON[7] = 0;
                  } else {
          itsON[7] = 1;
        }
        break;


      case code8:
        if (itsON[8] == 1) {
          Serial.flush();
          Serial.print("KEY,5,L");
                    itsON[8] = 0;
                  } else {
          itsON[8] = 1;
        }
        break;


      case code9:
        if (itsON[9] == 1) {
          Serial.flush();
          Serial.print("KEY,6,L");
                    itsON[9] = 0;
                  } else {
          itsON[9] = 1;
        }
        break;


      case code10:
        if (itsON[10] == 1) {
          Serial.flush();
          Serial.print("KEY,7,L");
                    itsON[10] = 0;
                  } else {
          itsON[10] = 1;
        }
        break;


      case code11:
        if (itsON[11] == 1) {
          Serial.flush();
          Serial.print("KEY,8,L");
                    itsON[11] = 0;
                 } else {
          itsON[11] = 1;
        }
        break;


      case code12:
        if (itsON[12] == 1) {
          Serial.flush();
          Serial.print("KEY,9,L");
                    itsON[12] = 0;
                  } else {
          itsON[12] = 1;
        }
        break;


      case code13:
        if (itsON[13] == 1) {
          Serial.flush();
          Serial.print("KEY,0,L");
                   itsON[13] = 0;
                  } else {
          itsON[13] = 1;
        }
        break;

    }
    Serial.println(value); // Needed for IR Codes
    irrecv.resume(); // Receive the next value
  }
}

No comments:

Post a Comment