-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathREADME
80 lines (51 loc) · 1.66 KB
/
README
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
This is a GPLd code produced by Paeae Technologies. Usually the code is suitable for Arduino platforms
if not specified otherwise.
Current projects:
Libraries/HTC595: small library for using x595 serial-in-parallel-out chips
Libraries/ds2482: library for controlling DS2482-100 and DS2482-800 1-wire masters.
Projects/altpromo: code and schematics for altparty promotion gadget
-----------
HTC595:
A small library for using 595 serial-in-parallel-out chips
If you have chained more than one 595, you need to define HTC_NUM_CASCADES before including htc595.h:
#define HTC_NUM_CASCADES 4
#include <htc595.h>
Constructor takes three parameters, pins for data,sh_cp and st_cp. Defaults are 5,7,6 respectively.
usage:
#define HTC_NUM_CASCADES 4 //four 595s chained
#include <htc595.h>
HTC595 htc(5,7,6); //using pin 5 for data,7 for sh_cp and 6 for st_cp
void loop()
{
uint8_t data[4] = { 1,1,1,1 }; //buffer size has to be atleast equal HTC_NUM_CASCADES
htc.update(data);
}
-----------
DS2482:
Arduino library for controlling DS2482-100 and DS2482-800 1-wire masters.
Uses Wire library to communicate with DS2482 so be sure to call Wire.begin() before using the library.
Quick example modeled after Onewire example:
#include
#include
DS2482 ds(0);
void setup()
{
Wire.begin();
ds.reset();
//configure DS2482 to use active pull-up instead of pull-up resistor
//configure returns 0 if it cannot find DS2482 connected
//if (!ds.configure(DS2482_CONFIG_APU))
//{
// Serial.print("DS2482 not found\n");
//}
}
void loop()
{
byte addr[8];
if ( !ds.wireSearch(addr))
{
//Serial.print("No more addresses.\n");
ds.wireResetSearch();
return;
}
}