![]() What the baud rate is which you need to use to communicate.What the AT command set of the module is.This should be available from wherever you purchased it. To progress you really need the manual for the shield. Nothing will happen until you have configured the shield using AT commands.Communication with the Arduino is done through UART serial, and the pins used for that communication are selected using the big bank of jumpers.The shield can run in two modes: AT command mode, which is used to configure it, and Transparent UART mode, which is used to communicate.You need to understand the basics before you try running code to "do things": PinMode(2,INPUT) pinMode(13,OUTPUT) attachInterrupt(0,cleantime,FALLING) init_timer2() Ĭase 1: digitalWrite(13,HIGH) Serial.print("Hellow BT") break Īnybody can help me decipher this code? none of this looks familiar to me Unsigned int timeout=0 unsigned char state=0 ĪSSR |= (0<<AS2) // Use internal clock - external clock not used in Arduino UPDATE 2: Here is the code from the PDF that was shipped with my shield: (THE LED IS GREEN, IT'S CONNECTED ON MAC AND ON BLUTERM) I connect it to the HC-05 BUT it doesn't send me anything back. I want to send these 1's and 0's through a Mac program called Bluterm. that uses a 1 to turn a led on and a 0 to turn it off. I have this serial program that I want to use to turn on a led.īut I can't seem to enter AT mode, or get any indication that besides it connecting to my Mac it's receiving or transmitting any signals.Īnybody got any tips for tutorials/tips for tests for a MAC OSX user? Int throttleAB, steeringAB, buttonAB // Sliders are not used (yet).Does anybody know how I can get it to connect to Arduino? WarningLights = false, BrakeLights = false, autoParking = false, lightsOn = false ![]() Int steerAngle = 90 // Start with default steer angle.īoolean FlasherLeft = false, FlasherRight = false, FlasherOn = false, RumbleBrake = false, #define Interval 1000 // Sample/Measure interval in msĬonst float f = 36000/IPCM // Speed m/h = f x Impulses / Intervalįloat velocity, distance // Speed & DistanceĪrduinoBlue remoteBLE(Serial) // BLE over RX/TX hardware serial!Īdafruit_MotorShield MShield = Adafruit_MotorShield(0圆0) Īdafruit_DCMotor *Motor = MShield.getMotor(1) // Main motorĪdafruit_DCMotor *Light = MShield.getMotor(2) // Headlights.Īdafruit_DCMotor *RedRearLight = MShield.getMotor(3) // Rear and brake light.Īdafruit_DCMotor *ReverseLight = MShield.getMotor(4) // Reverse light. #define IPCM 17.949 // My own value, derived from experiment and measure. #define IPCM 14.475 // Theoretical nr impulses per cm with 50mm wheels. #define REARLIGHT 100 // Default read light brightness, with headroom for brake light (=255) #define BTBaud 9600 // Configured/leaved my MT-19 BLE at 9600 baud. ![]() #define BTBaud 38400 // Did some experiments on 38400 baud. In my case: GREEN wire with level-shifter to (input) RxD of BT module connects to pin 1 (TxD output) of the Arduino In my case: YELLOW wire to (output) TxD of BT module connects to pin 0 (RxD input) of the Arduino Unplug the BT module during debug or upload! This version uses the normal hardware RX/TX pins 0 and 1. Because PWM pins 9 and 10 use timer1, there is a conflict in using Software Serial ArduinoBlue compatible, uses Adafruit AdaFruit MotorShield 'Flitzer' with Bluetooth remote joystick shield I made (just to be sure) a so-called level shifter with two resistors for the RxD of the module. I therefore chose to connect the module to the regular hardware serial on D0 and D1 and just unplug it during an occasional upload.īelow the connection diagram for the motor shield. In addition, the serial monitor of the Arduino IDE remains usable during development.īut unfortunately this turned out not to be possible because the servo library uses the same Arduino hardware timer for controlling the control servo as SoftwareSerial for its outgoing signals to the module.Įspecially when sending via the RxD input of the module, the result may be interference on the servo steering, sometimes causing violent servo jitter. This has the great advantage that the module does not have to be temporarily removed when a new Sketch is uploaded to the Arduino. This means that the serial communication does not have to take place over the hardware serial on D0 and D1, which are also used for the USB with which the Arduino is connected to the computer. Sketch and connection diagram for the carįor the communication between the Arduino and the Bluetooth module, the use of SoftwareSerial in the Sketch is obvious.
0 Comments
Leave a Reply. |