Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define MAX_RESET 7 //MAX3421E pin 12
- #define MAX_GPX 8 //MAX3421E pin 17
- #include <PS3USB.h>
- USB Usb;
- /* You can create the instance of the class in two ways */
- PS3USB PS3(&Usb); // This will just create the instance
- #include <Servo.h>
- Servo s1;
- int p1 = 100;
- int p2 = 5;
- void setup() {
- pinMode(MAX_GPX, INPUT);
- pinMode(MAX_RESET, OUTPUT);
- digitalWrite(MAX_RESET, LOW);
- delay(20);
- digitalWrite(MAX_RESET, HIGH);
- Serial.begin(115200);
- if (Usb.Init() == -1) {
- Serial.print(F("\r\nOSC did not start"));
- while(1);
- }
- s1.attach(7); //To cholerstwo powoduje problem
- Serial.print(F("\r\nPS3 Bluetooth Library Started"));
- }
- void loop() {
- Usb.Task();
- if (PS3.PS3Connected){
- s1.write(85);
- if (PS3.getButtonClick(TRIANGLE)) {
- s1.write(p1);
- Serial.print(F("\r\nTriangle"));
- }
- if (PS3.getButtonClick(CIRCLE)) {
- s1.write(p2);
- Serial.print(F("\r\nCircle"));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement