This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import smbus | |
| from time import sleep | |
| bus = smbus.SMBus(1) | |
| SLAVE_ADDRESS = 0x04 | |
| def writeCommand(cmd): | |
| bus.write_byte(SLAVE_ADDRESS, cmd) | |
| print("send: ",cmd) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <Wire.h> | |
| int SLAVE_ADDRESS = 0x04; | |
| int cmd = 1; | |
| int val = 0; | |
| void setup() { | |
| Wire.begin(SLAVE_ADDRESS); | |
| Wire.onReceive(receiveAnalogReading); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import smbus | |
| from time import sleep | |
| bus = smbus.SMBus(1) | |
| SLAVE_ADDRESS = 0x04 | |
| def writeCommand(num, ang): | |
| bus.write_byte(SLAVE_ADDRESS, num) | |
| print("send number: ", num) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <Wire.h> | |
| #include <Servo.h> | |
| int SLAVE_ADDRESS = 0x04; | |
| int cmd = 0; | |
| int servoNumber; | |
| int servoAngle; | |
| Servo myservo[2]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import smbus | |
| from time import sleep | |
| bus = smbus.SMBus(1) | |
| SLAVE_ADDRESS = 0x04 | |
| def writeCommand(cmd): | |
| bus.write_byte(SLAVE_ADDRESS, cmd) | |
| print("send: ",cmd) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <Wire.h> | |
| int SLAVE_ADDRESS = 0x04; | |
| int cmd = 0; | |
| int val = 0; | |
| void setup() { | |
| Wire.begin(SLAVE_ADDRESS); | |
| Wire.onReceive(receiveAnalogReading); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import smbus | |
| from time import sleep | |
| bus = smbus.SMBus(1) | |
| SLAVE_ADDRESS = 0x04 | |
| def writeCommand(cmd): | |
| bus.write_byte(SLAVE_ADDRESS, cmd) | |
| print("send: ",cmd) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <Wire.h> | |
| #include <Servo.h> | |
| int SLAVE_ADDRESS = 0x04; | |
| int cmd = 0; | |
| Servo myservo; | |
| void setup() { | |
| Wire.begin(SLAVE_ADDRESS); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import smbus | |
| from time import sleep | |
| bus = smbus.SMBus(1) | |
| SLAVE_ADDRESS = 0x04 | |
| def writeCommand(cmd): | |
| reading = bus.write_byte(SLAVE_ADDRESS, cmd) | |
| print("send: ",cmd) |