Dawn Robotics Forum Support and community forums for Dawn Robotics Ltd 2015-06-01T19:13:56+01:00 http://forum.dawnrobotics.co.uk/feed.php?f=12&t=1333 2015-06-01T19:13:56+01:00 2015-06-01T19:13:56+01:00 http://forum.dawnrobotics.co.uk/viewtopic.php?t=1333&p=1827#p1827 <![CDATA[Re: Yet Another DIY Bluetooth RC Car]]>
As of it working, I can definitively confirm, it does, on my MotoG 3G 2013 and on my Google/Asus Nexus 7 2012.
With sliders (SeekBars) for throttle and steering, and sending it text commands.

One thing I'd probably LIKE to do is to somehow add a feature to rename the BT receiver from HC-06 to something more, say, freeform. But this means the MD will need to send some AT commands at some specified speed to it probably. Which I hope won't be on their way to fry it.... Ever tried that?

Statistics: Posted by el_es — Mon Jun 01, 2015 7:13 pm


]]>
2015-06-01T19:03:43+01:00 2015-06-01T19:03:43+01:00 http://forum.dawnrobotics.co.uk/viewtopic.php?t=1333&p=1826#p1826 <![CDATA[Re: Yet Another DIY Bluetooth RC Car]]>
Then I'll have to replicate the code for sending strings to the BluetoothChat service, one that is in the BluetoothChat Fragment (https://android.googlesource.com/platfo ... rvice.java and around this is what I presume I've imported...)

(this https://android.googlesource.com/platfo ... hChat.java especially lines 206-221)

which I certainly hope will go well...

I am sorry, really... my Java skill level is approaching 0 exponentially ;J the more I read the less I understand of it ;)

Statistics: Posted by el_es — Mon Jun 01, 2015 7:03 pm


]]>
2015-06-01T12:41:01+01:00 2015-06-01T12:41:01+01:00 http://forum.dawnrobotics.co.uk/viewtopic.php?t=1333&p=1825#p1825 <![CDATA[Re: Yet Another DIY Bluetooth RC Car]]>
Code:
SensorActivity mSensorActivity;            // This goes with the other member variables

mSensorActivity = new SensorActivity();        // This goes wherever your setup code is


Looking at the sample you should just then need to put some printing code in the onSensorChanged code to see readings from the sensor. To get those sensor readings back into your control code you've got a number of options but essentially you need to use a callback that passes back the data.

Apologies if this is way off or completely unhelpful. I'm interested to see how this Android Bluetooth stuff works so will do my best to install the Android tools later this week. Then hopefully I can make some more sensible comments. :)

Regards

Alan

Statistics: Posted by Alan — Mon Jun 01, 2015 12:41 pm


]]>
2015-05-30T21:12:35+01:00 2015-05-30T21:12:35+01:00 http://forum.dawnrobotics.co.uk/viewtopic.php?t=1333&p=1822#p1822 <![CDATA[Re: Yet Another DIY Bluetooth RC Car]]> so, googling for answers how to integrate the motion (axis angle/gyroscope sensor) into my project, i found an interesting page http://developer.android.com/reference/ ... nager.html and a few others but this seems like something ... only have no clue how to integrate this .

I added the snippet as is to a file (bar it did not like that the class was public) and took AS's suggestions so it wouldn't error out. But now since my sendmessage() is in a different class (the Fragment...) i need to do something else, but what?
This http://developer.telerik.com/products/b ... eter-data/ looks simpler... but still no clue how to add that so it would work in an existing fragment/java class...
Yeah I know it's noobish. Please help/point... I am after the left/right turn and front/back turn angles so to use the device as a throttle or steering wheel.

Statistics: Posted by el_es — Sat May 30, 2015 9:12 pm


]]>
2015-05-29T00:57:51+01:00 2015-05-29T00:57:51+01:00 http://forum.dawnrobotics.co.uk/viewtopic.php?t=1333&p=1821#p1821 <![CDATA[Re: Yet Another DIY Bluetooth RC Car]]>
Code:
Index: Application/src/main/res/layout/fragment_bluetooth_chat.xml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- Application/src/main/res/layout/fragment_bluetooth_chat.xml   (revision )
+++ Application/src/main/res/layout/fragment_bluetooth_chat.xml   (revision )
@@ -17,15 +17,17 @@
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
               android:layout_width="match_parent"
               android:layout_height="match_parent"
-              android:orientation="vertical" >
+              android:orientation="vertical"
+    android:weightSum="1">
 
     <ListView
         android:id="@+id/in"
         android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:layout_weight="1"
+        android:layout_height="63dp"
         android:stackFromBottom="true"
-        android:transcriptMode="alwaysScroll" />
+        android:transcriptMode="alwaysScroll"
+        android:layout_weight="0.70"
+        android:clickable="false" />
 
     <LinearLayout
         android:layout_width="match_parent"
@@ -44,6 +46,64 @@
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:text="@string/send" />
+    </LinearLayout>
+    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+        android:layout_width="match_parent"
+        android:layout_height="63dp"
+        android:orientation="horizontal" >
+
+        <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:orientation="horizontal"
+            android:gravity="center_horizontal">
+
+            <Button
+            android:id="@+id/button_pf"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="Forward \nFull" />
+
+            <Button
+                android:id="@+id/button_tf"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="Reverse \nFull" />
+
+            <Button
+                android:id="@+id/button_s"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="Full \nStop" />
+        </LinearLayout>
+    </LinearLayout>
+    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+        android:layout_width="match_parent"
+        android:layout_height="63dp"
+        android:orientation="horizontal"
+        android:gravity="right">
+
+        <SeekBar
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:id="@+id/SteeringBar"
+            android:max="30"
+            android:clickable="true"
+            android:longClickable="true"
+            android:progress="15"
+            android:mirrorForRtl="false"
+            android:layout_weight="0.10" />
+
+        <SeekBar
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:id="@+id/ThrottleBar"
+            android:layout_weight="0.10"
+            android:progress="15"
+            android:max="15"
+            android:clickable="true"
+            android:longClickable="true" />
+
     </LinearLayout>
 
-</LinearLayout>
+</LinearLayout>
\ No newline at end of file


Code:
Index: Application/src/main/java/com/example/android/bluetoothchat/BluetoothChatFragment.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>windows-1252
===================================================================
--- Application/src/main/java/com/example/android/bluetoothchat/BluetoothChatFragment.java   (revision )
+++ Application/src/main/java/com/example/android/bluetoothchat/BluetoothChatFragment.java   (revision )
@@ -39,6 +39,8 @@
 import android.widget.Button;
 import android.widget.EditText;
 import android.widget.ListView;
+import android.widget.ProgressBar;
+import android.widget.SeekBar;
 import android.widget.TextView;
 import android.widget.Toast;
 
@@ -60,7 +62,19 @@
     private ListView mConversationView;
     private EditText mOutEditText;
     private Button mSendButton;
+/*    private Button mRFButton;
+    private Button mLFButton;*/
+    private Button mDCButton;
+    private Button mPFButton;
+   //private Button mP8Button;
+   // private Button mP5Button;
+    private Button mTFButton;
+   // private Button mT5Button;
+    private Button mStopButton;
+    SeekBar mSteeringBar;
+    SeekBar mThrottleBar;
 
+
     /**
      * Name of the connected device
      */
@@ -151,8 +165,15 @@
         mConversationView = (ListView) view.findViewById(R.id.in);
         mOutEditText = (EditText) view.findViewById(R.id.edit_text_out);
         mSendButton = (Button) view.findViewById(R.id.button_send);
+        mPFButton = (Button) view.findViewById(R.id.button_pf);
+        mTFButton = (Button) view.findViewById(R.id.button_tf);
+        mStopButton = (Button) view.findViewById(R.id.button_s);
+        mSteeringBar = (SeekBar) view.findViewById(R.id.SteeringBar);
+        mThrottleBar = (SeekBar) view.findViewById(R.id.ThrottleBar);
+
     }
 
+
     /**
      * Set up the UI and background operations for chat.
      */
@@ -180,12 +201,106 @@
             }
         });
 
+        mPFButton.setOnClickListener(new View.OnClickListener() {
+            public void onClick(View v) {
+                View view = getView();
+                if (null != view) {
+                  //  mPFButton.setBackgroundColor(0x00FF00);
+                  //  mTFButton.setBackgroundColor(0xFF0000);
+                   mPFButton.setTextColor(0xff0000);
+                   mTFButton.setTextColor(0x00ff00);
+                }
+
+            }
+        });
+
+        mTFButton.setOnClickListener(new View.OnClickListener() {
+            public void onClick(View v) {
+                View view = getView();
+                if (null != view) {
+                    //endMessage("TF");
+                    //mPFButton.setBackgroundColor(0xFF00);
+                   // mTFButton.setBackgroundColor(0x00FF00);
+                   mPFButton.setTextColor(0x00FF00);
+                   mTFButton.setTextColor(0xFF0000);
+                }
+
+            }
+        });
+
+        mStopButton.setOnClickListener(new View.OnClickListener() {
+            public void onClick(View v) {
+                View view = getView();
+                if (null != view) {
+                    sendMessage("S");
+                }
+            }
+        });
+
+        mSteeringBar.setOnSeekBarChangeListener(
+                new SeekBar.OnSeekBarChangeListener() {
+
+                    @Override
+                    public void onProgressChanged(SeekBar seekBar, int i, boolean b) {
+                        int aposition = i - 15;
+                        String message = "";
+                        if (aposition < 0) {
+                            aposition = -aposition;
+                            message = "L".concat(Integer.toHexString(aposition));
+                        } else {
+                            message = "R".concat(Integer.toHexString(aposition));
+                        }
+                        sendMessage(message);
+                    }
+
+                    @Override
+                    public void onStartTrackingTouch(SeekBar seekBar) {
+                        // TODO Auto-generated method stub
+                    }
+
+                    @Override
+                    public void onStopTrackingTouch(SeekBar seekBar) {
+                        // TODO Auto-generated method stub
+                        seekBar.setProgress(15);
+                    }
+                });
+
+        mThrottleBar.setOnSeekBarChangeListener(
+                new SeekBar.OnSeekBarChangeListener() {
+
+                    @Override
+                    public void onProgressChanged(SeekBar seekBar, int i, boolean b) {
+                        int aposition = 15-i;
+                        String message = "";
+                        if (mPFButton.getCurrentTextColor() == 0xff0000){
+                            message = "P".concat(Integer.toHexString(aposition));
+                        }
+                        if (mTFButton.getCurrentTextColor() == 0xff0000){
+                            message = "T".concat(Integer.toHexString(aposition));
+                        }
+                        sendMessage(message);
+                    }
+
+                    @Override
+                    public void onStartTrackingTouch(SeekBar seekBar) {
+
+                    }
+
+                    @Override
+                    public void onStopTrackingTouch(SeekBar seekBar) {
+                        seekBar.setProgress(15);
+                    }
+                }
+        );
+
         // Initialize the BluetoothChatService to perform bluetooth connections
         mChatService = new BluetoothChatService(getActivity(), mHandler);
 
         // Initialize the buffer for outgoing messages
         mOutStringBuffer = new StringBuffer("");
     }
+
+
 
     /**
      * Makes this device discoverable.

Statistics: Posted by el_es — Fri May 29, 2015 12:57 am


]]>
2015-05-28T23:35:20+01:00 2015-05-28T23:35:20+01:00 http://forum.dawnrobotics.co.uk/viewtopic.php?t=1333&p=1820#p1820 <![CDATA[Re: Yet Another DIY Bluetooth RC Car]]> also i finally got what the AS wanted of me... the prototype of the OnSeekBarChangeListener onProgressChanged to implement, looks different...

Code:
mSteeringBar.setOnSeekBarChangeListener(
                new SeekBar.OnSeekBarChangeListener() {

                    @Override
                    public void onProgressChanged(SeekBar seekBar, int i, boolean b) {
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
// i had something else ;) even if still technically same types of variables...
                        int aposition = i - 16;
                        String message = "";
                        if (aposition < 0) {
                            aposition = -aposition;
                            message = "L".concat( Integer.toHexString(aposition));
                        }
                        else
                        {
                            message = "R".concat(Integer.toHexString(aposition));
                        }
                        sendMessage(message);
                    }

                    @Override
                    public void onStartTrackingTouch(SeekBar seekBar) {
                        // TODO Auto-generated method stub
                    }

                    @Override
                    public void onStopTrackingTouch(SeekBar seekBar) {
                        // TODO Auto-generated method stub
                    }
                });

So now onwards to do a fully on-sliders app ;)

Statistics: Posted by el_es — Thu May 28, 2015 11:35 pm


]]>
2015-05-28T23:20:25+01:00 2015-05-28T23:20:25+01:00 http://forum.dawnrobotics.co.uk/viewtopic.php?t=1333&p=1819#p1819 <![CDATA[Re: Yet Another DIY Bluetooth RC Car]]> having been sitting on this problem till 1am in the morning, probably did not help my understanding either ;)

however, to me java is one of the less understandable languages :) Pascal Forever ;)

Statistics: Posted by el_es — Thu May 28, 2015 11:20 pm


]]>
2015-05-27T23:08:01+01:00 2015-05-27T23:08:01+01:00 http://forum.dawnrobotics.co.uk/viewtopic.php?t=1333&p=1818#p1818 <![CDATA[Re: Yet Another DIY Bluetooth RC Car]]>
I think that what your compiler is saying is that you also need to provide an override for the method onStopTrackingTouch. This question on stackoverflow has a snippet which looks similar. So bascially you may have some joy by adding these 2 overrides

Code:
@Override
    public void onStartTrackingTouch(SeekBar seekBar) {
        // TODO Auto-generated method stub
    }

    @Override
    public void onStopTrackingTouch(SeekBar seekBar) {
        // TODO Auto-generated method stub
    }


Regards

Alan

Statistics: Posted by Alan — Wed May 27, 2015 11:08 pm


]]>
2015-05-27T00:24:06+01:00 2015-05-27T00:24:06+01:00 http://forum.dawnrobotics.co.uk/viewtopic.php?t=1333&p=1817#p1817 <![CDATA[Re: Yet Another DIY Bluetooth RC Car]]>
Code:
//        mSteeringBar.setOnSeekBarChangeListener(
//                new SeekBar.OnSeekBarChangeListener() {
^^^^^ when uncommented, this line goes red with error below ^^^^^^^
//                    @Override
//                    public void OnProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
//                        int aposition = progress - 16;
//                        String message = "";
//                        if (aposition < 0) {
//                            aposition = -aposition;
//                            message = "L".concat( Integer.toHexString(aposition));
//                        }
//                        else
//                        {
//                            message = "R".concat(Integer.toHexString(aposition));
//                        }
//                        sendMessage(message);
//                    }
//                });

It's in comments, because it won't let me :(
it says

Error:(287, 55) error: <anonymous com.example.android.bluetoothchat.BluetoothChatFragment$11> is not abstract and does not override abstract method onStopTrackingTouch(SeekBar) in OnSeekBarChangeListener


Pls help, I so don't understand this error :(

Statistics: Posted by el_es — Wed May 27, 2015 12:24 am


]]>
2015-05-24T23:40:34+01:00 2015-05-24T23:40:34+01:00 http://forum.dawnrobotics.co.uk/viewtopic.php?t=1333&p=1811#p1811 <![CDATA[Re: Yet Another DIY Bluetooth RC Car]]> and it goes well, as far as sending text commands at button press can go :)

Also the discussion about b/o protection just about to take an unexpected turn: i changed batteries for a new set of 5 x aaa...

and now, pf and tf command does not brown out any more :) and the speed, it's MASSIVE :)
can't wait to test it outdoors.

In the mean time, also looking which way better to share what I wrote...

I will paste patches into this post.
(I changed the BluetoothChatFragment.java and fragment_bluetooth_chat.xml and the BluetoothChatService.java)

Code:
Index: Application/src/main/java/com/example/android/bluetoothchat/BluetoothChatService.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>windows-1252
===================================================================
--- Application/src/main/java/com/example/android/bluetoothchat/BluetoothChatService.java   (revision )
+++ Application/src/main/java/com/example/android/bluetoothchat/BluetoothChatService.java   (revision )
@@ -46,11 +46,11 @@
     private static final String NAME_SECURE = "BluetoothChatSecure";
     private static final String NAME_INSECURE = "BluetoothChatInsecure";
 
-    // Unique UUID for this application
+    // Unique UUID for this application  // el_es : serial port profile UUID
     private static final UUID MY_UUID_SECURE =
-            UUID.fromString("fa87c0d0-afac-11de-8a39-0800200c9a66");
+            UUID.fromString("00001101-0000-1000-8000-00805f9b34fb");  //fa87c0d0-afac-11de-8a39-0800200c9a66");
     private static final UUID MY_UUID_INSECURE =
-            UUID.fromString("8ce255c0-200a-11e0-ac64-0800200c9a66");
+            UUID.fromString("00001101-0000-1000-8000-00805f9b34fb");  //8ce255c0-200a-11e0-ac64-0800200c9a66");
 
     // Member fields
     private final BluetoothAdapter mAdapter;


Code:
Index: Application/src/main/res/layout/fragment_bluetooth_chat.xml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- Application/src/main/res/layout/fragment_bluetooth_chat.xml   (revision )
+++ Application/src/main/res/layout/fragment_bluetooth_chat.xml   (revision )
@@ -45,5 +45,68 @@
             android:layout_height="wrap_content"
             android:text="@string/send" />
     </LinearLayout>
+    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+        android:layout_width="match_parent"
+        android:layout_height="63dp"
+        android:orientation="horizontal" >
+        <Button
+            android:id="@+id/button_lf"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="Left \nFull" />
+        <Button
+            android:id="@+id/button_dc"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="Dir \nCenter" />
+        <Button
+            android:id="@+id/button_rf"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="Right \nFull" />
+        <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:orientation="horizontal"
+            android:gravity="right">
+            <Button
+            android:id="@+id/button_pf"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="Forward \nFull" />
+            <Button
+            android:id="@+id/button_p8"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="Forward \nHalf" />
+            <Button
+                android:id="@+id/button_p5"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="Forward \nQuarter" />
+
+        </LinearLayout>
+    </LinearLayout>
+    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+        android:layout_width="match_parent"
+        android:layout_height="63dp"
+        android:orientation="horizontal"
+        android:gravity="right">
+        <Button
+            android:id="@+id/button_tf"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="Reverse \nFull" />
+        <Button
+            android:id="@+id/button_t5"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="Reverse \nQuarter" />
+        <Button
+            android:id="@+id/button_s"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="Full \nStop" />
+        </LinearLayout>
 
 </LinearLayout>


Code:
Index: Application/src/main/java/com/example/android/bluetoothchat/BluetoothChatFragment.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>windows-1252
===================================================================
--- Application/src/main/java/com/example/android/bluetoothchat/BluetoothChatFragment.java   (revision )
+++ Application/src/main/java/com/example/android/bluetoothchat/BluetoothChatFragment.java   (revision )
@@ -60,6 +60,15 @@
     private ListView mConversationView;
     private EditText mOutEditText;
     private Button mSendButton;
+    private Button mRFButton;
+    private Button mLFButton;
+    private Button mDCButton;
+    private Button mPFButton;
+    private Button mP8Button;
+    private Button mP5Button;
+    private Button mTFButton;
+    private Button mT5Button;
+    private Button mStopButton;
 
     /**
      * Name of the connected device
@@ -151,6 +160,15 @@
         mConversationView = (ListView) view.findViewById(R.id.in);
         mOutEditText = (EditText) view.findViewById(R.id.edit_text_out);
         mSendButton = (Button) view.findViewById(R.id.button_send);
+        mRFButton = (Button) view.findViewById(R.id.button_rf);
+        mLFButton = (Button) view.findViewById(R.id.button_lf);
+        mDCButton = (Button) view.findViewById(R.id.button_dc);
+        mPFButton = (Button) view.findViewById(R.id.button_pf);
+        mP8Button = (Button) view.findViewById(R.id.button_p8);
+        mP5Button = (Button) view.findViewById(R.id.button_p5);
+        mTFButton = (Button) view.findViewById(R.id.button_tf);
+        mT5Button = (Button) view.findViewById(R.id.button_t5);
+        mStopButton = (Button) view.findViewById(R.id.button_s);
     }
 
     /**
@@ -176,6 +194,84 @@
                     TextView textView = (TextView) view.findViewById(R.id.edit_text_out);
                     String message = textView.getText().toString();
                     sendMessage(message);
+                }
+            }
+        });
+
+        mRFButton.setOnClickListener(new View.OnClickListener() {
+            public void onClick(View v) {
+                View view = getView();
+                if (null != view) {
+                    sendMessage("RF");
+                }
+            }
+        });
+
+        mDCButton.setOnClickListener(new View.OnClickListener() {
+            public void onClick(View v) {
+                View view = getView();
+                if (null != view) {
+                    sendMessage("L0");
+                }
+            }
+        });
+
+        mLFButton.setOnClickListener(new View.OnClickListener() {
+            public void onClick(View v) {
+                View view = getView();
+                if (null != view) {
+                    sendMessage("LF");
+                }
+            }
+        });
+
+        mPFButton.setOnClickListener(new View.OnClickListener() {
+            public void onClick(View v) {
+                View view = getView();
+                if (null != view) {
+                    sendMessage("PF");
+                }
+            }
+        });
+        mP8Button.setOnClickListener(new View.OnClickListener() {
+            public void onClick(View v) {
+                View view = getView();
+                if (null != view) {
+                    sendMessage("P8");
+                }
+            }
+        });
+        mP5Button.setOnClickListener(new View.OnClickListener() {
+            public void onClick(View v) {
+                View view = getView();
+                if (null != view) {
+                    sendMessage("P5");
+                }
+            }
+        });
+        mTFButton.setOnClickListener(new View.OnClickListener() {
+            public void onClick(View v) {
+                View view = getView();
+                if (null != view) {
+                    sendMessage("TF");
+                }
+            }
+        });
+
+        mT5Button.setOnClickListener(new View.OnClickListener() {
+            public void onClick(View v) {
+                View view = getView();
+                if (null != view) {
+                    sendMessage("T5");
+                }
+            }
+        });
+
+        mStopButton.setOnClickListener(new View.OnClickListener() {
+            public void onClick(View v) {
+                View view = getView();
+                if (null != view) {
+                    sendMessage("S");
                 }
             }
         });

Statistics: Posted by el_es — Sun May 24, 2015 11:40 pm


]]>
2015-05-22T18:46:07+01:00 2015-05-22T18:46:07+01:00 http://forum.dawnrobotics.co.uk/viewtopic.php?t=1333&p=1809#p1809 <![CDATA[Re: Yet Another DIY Bluetooth RC Car]]>
But I upload a 'sketch' from the IDE, which is unlike any uC program I ever wrote ;)

So the fault must also be somewhere in the sketch stub code, the one that actually calls setup() and loop() off my sketch... there must be some (more) code there, right? That links with the compiled output of the .ino.

And there I could not again find any suppressors/ferrites/filters in my junk... deadlines etc. Will be back next week, for now I need to concentrate on getting the bluetooth control app going ;)

Statistics: Posted by el_es — Fri May 22, 2015 6:46 pm


]]>
2015-05-22T09:20:39+01:00 2015-05-22T09:20:39+01:00 http://forum.dawnrobotics.co.uk/viewtopic.php?t=1333&p=1808#p1808 <![CDATA[Re: Yet Another DIY Bluetooth RC Car]]>
Capacitors on the motors are probably a must for stability. I've left them off the Pi robotkit we sell just because the motors are so small, but your motors sound larger. :)

Even without capacitors though, I would have hoped that a brown out wouldn't corrupt the onboard flash memory. :?

Statistics: Posted by Alan — Fri May 22, 2015 9:20 am


]]>
2015-05-21T23:24:00+01:00 2015-05-21T23:24:00+01:00 http://forum.dawnrobotics.co.uk/viewtopic.php?t=1333&p=1806#p1806 <![CDATA[Re: Yet Another DIY Bluetooth RC Car]]>
el_es wrote:
Is it possible at all to program the Arduino-ish board without ^^^

^^^ without bootloader, I was to say ;)

Statistics: Posted by el_es — Thu May 21, 2015 11:24 pm


]]>
2015-05-21T21:36:25+01:00 2015-05-21T21:36:25+01:00 http://forum.dawnrobotics.co.uk/viewtopic.php?t=1333&p=1805#p1805 <![CDATA[Re: Yet Another DIY Bluetooth RC Car]]> )

I'm getting more and more convinced I need a) some serous spike filters on motors and b) additional electrolytic cap somewhere in region of at least 4700uF (I do not wish to change /add cap on the board directly... though maybe I should actually)

Reason is, if I give my program a full-throttle forwards (pf) or backwards (tf) command, the bor condition happens not just to the ATMega but also to the Bluetooth module. If I change the current gradually (p8, p9, etc. pf) then the spike is not happening.

Atmel's susceptibility to BOR and spikes isn't exactly news to me (been round mailing lists and designed a board for AT89c2051 (prog'd in asm) and a board for at90c4051 (in c) and ended up using their recommeded way of external por/bor detector... but then I used flash data rom to keep strings in ;)

Statistics: Posted by el_es — Thu May 21, 2015 9:36 pm


]]>
2015-05-21T15:12:02+01:00 2015-05-21T15:12:02+01:00 http://forum.dawnrobotics.co.uk/viewtopic.php?t=1333&p=1801#p1801 <![CDATA[Re: Yet Another DIY Bluetooth RC Car]]>
I enjoy those moments when things start working. Makes the times when I'm swearing and tearing my hair out much easier to take. :D

Your idea of programming the Mini Driver with SPI is a great one, as then it would be possible to rule the bootloader out as a possible suspect.

On page 211 of the Atmega8 Datasheet it says


Flash corruption can easily be avoided by following these design recommendations (one is
sufficient):
1. If there is no need for a Boot Loader update in the system, program the Boot Loader Lock
Bits to prevent any Boot Loader software updates
2. Keep the AVR RESET active (low) during periods of insufficient power supply voltage.
This can be done by enabling the internal Brown-out Detector (BOD) if the operating volt-
age matches the detection level. If not, an external low VCC Reset Protection circuit can
be used. If a reset occurs while a write operation is in progress, the write operation will be
completed provided that the power supply voltage is sufficient
3. Keep the AVR core in Power-down sleep mode during periods of low VCC. This will pre-
vent the CPU from attempting to decode and execute instructions, effectively protecting
the SPMCR Register and thus the Flash from unintentional writes


Now, from what I can see of the lock bits set for the Arduino IDE in hardware/arduino/boards.txt, the Boot Loader Lock Bits are set to preven Bootloader software updates, so in theory this one thing should be sufficient to prevent flash corruption, i.e. as I understand it setting up Brown-out Detection shouldn't be needed. The fact that we're still seeing corruption is what makes me think that somehow the bootloader is the culprit.

Regards

Alan

Statistics: Posted by Alan — Thu May 21, 2015 3:12 pm


]]>