|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools |
Rating:
|
Display Modes |
|
#28
|
|
Re: Driver Station Usb
simple test program for arduino which i am using for the pots right now
Code:
#include <Wire.h>
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
}
byte value = 0;
byte ch1 = 0x28;
byte ch2 = 0x29;
byte pot1 = 0xA9;
byte pot2 = 0xAA;
void loop()
{
writePot(ch1, pot1, value);
writePot(ch1, pot2, value);
writePot(ch2, pot1, value);
writePot(ch2, pot2, value);
value++; // increment value
if(value == 256)
{
value = 0; // start over from lowest value
}
delay(100);
}
void writePot(int chip, int pot, int val)
{
Wire.beginTransmission(chip); // transmit to device 0x28)
Wire.send(pot); // sends instruction byte,
// write to potentiometer-0
Wire.send(val); // sends potentiometer value byte
Wire.endTransmission(); // stop transmitting
}
|
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Driver Station S.O.S. | M. Gildner | Electrical | 15 | 28-11-2009 19:35 |
| Driver Station | dnrobotics11 | Control System | 2 | 18-02-2009 21:35 |
| driver station does not recognize usb 3 or 4... | aksharma | Technical Discussion | 0 | 07-02-2009 12:57 |
| Driver station only regognizes USB 1 and 2 | cvxdes | Programming | 14 | 05-02-2009 14:40 |