Jump to content
 

alangdance

Members
  • Posts

    280
  • Joined

  • Last visited

Everything posted by alangdance

  1. Hi Giles Do you have any tips for using the Emblaster 2 as I am new to the laser cutting world.
  2. I am looking to get a Blaster 2 but would like to know what tax would I need to pay? Is there anything I need to do before I buy or will the shipment company deal with all taxes? Any help would be most grateful. Regards Alan
  3. where did you get the winding assembly from. ? you mention RATIO BUT I CAN NOT FIND ANY REERENCE TO IT ON THE PECO SITE.
  4. Thanks NinOz for your suggestion. I have a sketch written for I2C with the DCC so I can change this with the serial. I have a few spare Nano.
  5. Hi NinOz Please see below for the original sketch for the Bluetooth. All I have done is added it to the loop of Tender's Sketch that is on entry 48. I tested it also on other know working DCC sketch with the same outcome. If I check the serial monitor there is some messages but none sent from the sketch. It looks like they are coming from one of the libraries. Even if I sent a ON or OFF from the serial Monitor it still not working. Is the interrupt that the DCC is using causing the serial monitor not to work? Working Bluetooth sketch below:- /* This sketch is part of a tutorial for connecting to and communicating with an HC-06 or an RN-42 bluetooth module using a custom Android App. The bluetooth modules are connected to an Arduino and the Arduino is connected to an LED. The Android app is used to wirelessly turn on and off the LED using bluetooth. This code is in the public domain. */ // Pin 13 has a LED connected to it int led = 13; // the setup routine runs once when you press reset: void setup() { Serial.begin(9600); // initialize the digital pin as an output and set it low initially pinMode(led, OUTPUT); digitalWrite(led, LOW); } // the loop routine runs over and over again forever: void loop() { delay(30); String t; //create an empty string to store messages from Android while(Serial.available()) { //keep reading bytes while they are still more in the buffer t += (char)Serial.read(); //read byte, convert to char, and append it to string } if(t.length()) { //if string is not empty do the following if(t == "ON") { //if the string is equal to "on" then turn LED on digitalWrite(led, HIGH); //Set digital pin to high to turn LED on Serial.write("Moving to Main Track CW"); //Tell the Android app that the LED was turned on } else if (t == "OFF") { digitalWrite(led, LOW); Serial.write("Moving to Main Track CCW"); } // turn the LED off by making the voltage LOW } } Regarding your question about the DCC sketch you would be better asking Tender as this is his sketch Any help would be most grateful Alan
  6. I have 2 sketches that I am using to control a turntable. One is Tender's DCC Turntable control and one that uses a Bluetooth module connected to the Arduino and controlled by an Android phone. Both sketches work on their own but when I combine the 2 sketches the Bluetooth sketch is not working. I have added the Bluetooth control to the Loop as this is only a serial Read but this does not seem to work. I have use pins 0 & 1 for the RX and TX for the Bluetooth and Interrupt 0 for the DCC signal. See code below // DCC Turntable Control Test Routines #include <DCC_Decoder.h> #include <AccelStepper.h> #include <Wire.h> #include <Adafruit_MotorShield.h> #include "utility/Adafruit_PWMServoDriver.h" ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // // Defines and structures // #define kDCC_INTERRUPT 0 typedef struct { int address; // Address to respond to } DCCAccessoryAddress; DCCAccessoryAddress gAddresses[8]; //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// // // Adafruit Setup Adafruit_MotorShield AFMStop(0x60); // Default address, no jumpers // Connect stepper with 200 steps per revolution (1.8 degree) // to the M3, M4 terminals (blue,yellow,green,red) Adafruit_StepperMotor *myStepper2 = AFMStop.getStepper(200, 2); // you can change these to SINGLE, DOUBLE, INTERLEAVE or MICROSTEP! // wrapper for the motor! (3200 Microsteps/revolution) void forwardstep2() { myStepper2->onestep(FORWARD, MICROSTEP); } void backwardstep2() { myStepper2->onestep(BACKWARD, MICROSTEP); } // Now we'll wrap the stepper in an AccelStepper object AccelStepper stepper2(forwardstep2, backwardstep2); ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// int led = 13; int test = 0; int rotate = 0; int sensorVal = digitalRead(3); ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // // Decoder Init // void ConfigureDecoder() { gAddresses[0].address = 200; gAddresses[1].address = 201; gAddresses[2].address = 202; gAddresses[3].address = 203; gAddresses[4].address = 204; gAddresses[5].address = 205; gAddresses[6].address = 206; gAddresses[7].address = 207; } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // // Basic accessory packet handler // void BasicAccDecoderPacket_Handler(int address, boolean activate, byte data) { // Convert NMRA packet address format to human address address -= 1; address *= 4; address += 1; address += (data & 0x06) >> 1; boolean enable = (data & 0x01) ? 1 : 0; for(int i=0; i<(int)(sizeof(gAddresses)/sizeof(gAddresses[0])); i++) { if( address == gAddresses[i].address ) { Serial.print("Basic addr: "); Serial.print(address,DEC); Serial.print(" activate: "); Serial.println(enable,DEC); if( enable ) { switch (i) { case 1: stepper2.moveTo(200); break; case 2: stepper2.moveTo(400); break; case 3: stepper2.moveTo(600); break; case 4: test = HIGH; Test(); break; case 5: stepper2.runToNewPosition(1600); break; case 6: rotate = HIGH; Rotate(); break; } } else{ switch (i) { case 1: stepper2.moveTo(1800); break; case 2: stepper2.moveTo(2000); break; case 3: stepper2.moveTo(2200); break; case 4: test = LOW; Test(); break; case 5: stepper2.runToNewPosition(-1600); break; case 6: rotate = LOW; Rotate(); break; } } } } } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // // Setup // void setup() { Serial.begin(9600); // initialize the digital pin as an output and set it low initially pinMode(led, OUTPUT); digitalWrite(led, LOW); AFMStop.begin(); // Start the shield //configure pin3 as an input and enable the internal pull-up resistor pinMode(3, INPUT_PULLUP); //read the sensor (open collector type) value into a variable //set stepper motor speed and acceleration stepper2.setMaxSpeed(30.0); stepper2.setAcceleration(20.0); // stepper2.moveTo(800); // if near reference point move away sensorVal = digitalRead(3); while (sensorVal == LOW) { sensorVal = digitalRead(3); forwardstep2(); delay(50); } // step forward to sensor index point while (sensorVal == HIGH) { sensorVal = digitalRead(3); forwardstep2(); delay(50); } DCC.SetBasicAccessoryDecoderPacketHandler(BasicAccDecoderPacket_Handler, true); ConfigureDecoder(); DCC.SetupDecoder( 0x00, 0x00, kDCC_INTERRUPT ); } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // // Main loop // void loop() { static int addr = 0; //////////////////////////////////////////////////////////////// // Loop DCC library DCC.loop(); //////////////////////////////////////////////////////////////// // Bump to next address to test if( ++addr >= (int)(sizeof(gAddresses)/sizeof(gAddresses[0])) ) { addr = 0; } stepper2.run(); String t; //create an empty string to store messages from Android while(Serial.available()) { //keep reading bytes while they are still more in the buffer t += (char)Serial.read(); //read byte, convert to char, and append it to string } if(t.length()) { //if string is not empty do the following if(t == "Ton") { //if the string is equal to "on" then turn LED on digitalWrite(led, HIGH); //Set digital pin to high to turn LED on Serial.write("Moving to Main Track CW"); //Tell the Android app that the LED was turned on } else if (t == "Toff") { digitalWrite(led, LOW); Serial.write("Moving to Main Track CCW"); } // turn the LED off by making the voltage LOW } } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// void Test(){ // step forward to sensor index point while (sensorVal == HIGH) { sensorVal = digitalRead(3); forwardstep2(); delay(50); } delay(5000); // set stepper speed, acceleration and position stepper2.setMaxSpeed(50.0); stepper2.setAcceleration(10.0); stepper2.moveTo(800); if (stepper2.distanceToGo() == 0) { delay(5000); stepper2.moveTo(-stepper2.currentPosition()); } //stepper2.run(); //maybe needed } void Rotate(){ if (rotate == HIGH ){ stepper2.runToNewPosition(3200); } else{ stepper2.runToNewPosition(-3200); } } Can anyone can point me in the right direction. Alan
  7. Sorry forgot to add the code String t; //create an empty string to store messages from Android while(Serial.available()) { //keep reading bytes while they are still more in the buffer t += (char)Serial.read(); //read byte, convert to char, and append it to string } if(t.length()) { //if string is not empty do the following if(t == "Ton") { //if the string is equal to "on" then turn LED on digitalWrite(led, HIGH); //Set digital pin to high to turn LED on Serial.write("Moving to Main Track CW"); //Tell the Android app that the LED was turned on } else if (t == "Toff") { digitalWrite(led, LOW); Serial.write("Moving to Main Track CCW"); } // turn the LED off by making the voltage LOW } Alan
  8. I have 2 sketches that I am using to control a turntable. One is Tender's DCC Turntable control and one that uses a Bluetooth module connected to the Arduino and controlled by an Android phone. Both sketches work on their own but when I combine the 2 sketches the Bluetooth sketch is not working. I have added the Bluetooth control to the Loop as this is only a serial Read but this does not seem to work. I have use pins 0 & 1 for the RX and TX for the Bluetooth and Interrupt 0 for the DCC signal. Can anybody point me in the right direction why the serial read is not working when joined to the DCC Turntable Sketch. Alan
  9. Richard do you have link on ebay for this board. I am unable to find any near that price, even from china Alan
  10. A never option is to connected together 2 or more Arduino boards using the IC2 connections. This is again a 2 wire system. I am at the moment looking into this as a possible solution. Alan
  11. Just had a look at the Adafruit for myself looks like a good option but if your looking at costs then the Nano or Pro mini would be a better option. Can not seem to pick the Adafruit for less than a Tenner but you can pick up Nano's for about £2 pounds and Pro mini for less. Alan
  12. Does anybody have any comments on the new Stainless steel rail from DCC Concept. Do we have an issue with electrical pick as SS does not conduct electricity as good as nickel silver? Can we overcome the pick up issue with more droppers? Does it actually require much less cleaning as stated by DCC Concept? Has anybody used the new SS. Regards Alan
  13. Thanks Ray I had a similar idea myself once I work out the while function. I am still learning about the code for Arduino. I am not in a position yet to do any testing but hope to have the traverser built in the next few weeks. Alan
  14. HI Ray If I was to use your sketch for a traverser is there any parts from the sketch that would need changing. I think you mentioned that on setup the stepper motor will go forward and backwards to find it 's reference point. I think this may be a issue with a traverser. Any help would be most grateful. Alan
  15. let's know what the out come is. does the ballast move when wetting it down. Does the ballast go rock hard like the old humbrol casmite. Can we have some more photos once it's dried and cleaned up. Alan
  16. Really enjoying this series of articles on turntable control. I will be having ago myself in the near further but cannot seem to be able to source the stepper motor. Where can I get hold of the stepper motor that cambriancoaster and Tender are using. Regards Alan
  17. Would it be possible to use a pin point applicator instead of a brush or cocktail stick. Maybe a bit more control over the glue. Any comments? Alan
  18. Yes I have thought of this using the worm gear and large gear you get with the Peco turntable kits but still will need the motor above the baseboard. Alan
  19. Thanks fot the comments. I like your idea but will have to look into the mounting of the motor as I have no room under the baseboard Alan
  20. This is looking like a very good article. Do you think it would be possible to have the motor above the baseboard and driven from a timing belt. Alan
  21. Hi Gordon Thanks for the great tutorial. I have been thinking about building some 00-SF points. My only issue that I am not to sure of is all my stock is RTR and with the varing standards supplied my the manufactories will the be issues with the stock through the common crossing. Do you have any dos and don'ts for running RTR stock through the ))-SF points. Alan
×
×
  • Create New...