Updates from September, 2016 Toggle Comment Threads | Keyboard Shortcuts

  • drahfa 7:16 am on September 4, 2016 Permalink | Reply
    Tags: , internet of things, windows virtual shield   

    Measure distance using ping sensor and display it using Lumia 430 (Windows Virtual Shield) 

    On the next journey of tinkering with Windows Virtual Shield, I combined the use of ping sensor to measure distance and attempted to display the distance using Lumia 430 (Windows Virtual Shield).

    Example codes that got ‘Frankensteined’ in this work are from the Ping Example and Windows Virtual Shield Example. Have a look below and see if you can replicate the same thing.

    Capture1Capture2

    Advertisements
     
  • drahfa 3:17 am on September 4, 2016 Permalink | Reply
    Tags: , virtual shield, windows 10   

    Hello World Windows Virtual Shield lessons learned. 

    I have been attempting to run Hello World code using my Windows 10 Phone (Lumia 430, price RM 179) since 4 days ago to no avail. After a while, I have managed to run a successful example from this video:

    Some of the lessons learned:

    Problem: The Windows Virtual Shield app downloaded via Windows Store freeze once the phone and bluetooth connected.
    Solution: See link Download Visual Studio 2015, download the source code of Windows Virtual Shield and deploy the codes to the phone via Visual Studio 2015.

    Problem: Screen remain blank after device connected within Windows Virtual Shield.
    Solution: Use the Arduino code below. I’m suspecting that the function ‘refresh’ will help to re-render the screen hence show the Hello World text on the phone.

    Problem: No data received / shown
    Solution: Make sure the baud rate matched with the bluetooth specification. I’m using JY-MCU BT_BOARD V1.03. Its baud rate is 9600.

     
  • drahfa 9:52 am on July 26, 2013 Permalink | Reply  

    Migrated to Linode, Ubuntu 13.04 upgrade: php mkdir failed problem solved 

    I’m migrating my blog to my Linode VPS from a shared hosting. While most of the tutorials are very good, especially this part, I was struggling to install wordpress plugin, or any actions that require php to create directory.

    It turns out that although the permissions, owner and group are all correct, in which pointed to the myusername, I still could not make my php to create directory to save its life. Until I found this in stackoverflow.

    Basically what solved my problem was:
    1. sudo nano /etc/apache2/envvars
    2. Look for export APACHE_RUN_USER=www-data and export APACHE_RUN_GROUP=www-data
    3. Change it to APACHE_RUN_USER=myusername and export APACHE_RUN_GROUP=myusername
    4. Save and quit
    5. Restart apache

    Now I can enjoy my nice Linode VPS happily.

     
  • drahfa 4:28 am on July 26, 2013 Permalink | Reply
    Tags: ubuntu   

    Updating Ubuntu Server via SSH 

    If you’re having a web server running on top of ubuntu, the update is easy.
    In SSH, you’ll see something like this:

    45 packages can be updated.
    23 updates are security updates.
    

    Simply type:

    sudo apt-get dist-upgrade
    

    It will request your password. Once you key in your password, your ubuntu installation shall be updated.

     
  • drahfa 2:56 am on July 18, 2013 Permalink | Reply  

    Testing DFRobot APC220 Radio Communication Module with Arduino Blink Example 

    I got my hands on the APC 220 Communication Module from DFRobot for our robotic fish project [1] .

    In this test, I use the LED Blink example, modded to include the serial port reading. While in the LED Blink example, you can just hook the positive point of LED to Pin 13 and its negative point to ground (GND), while the additional connections for the APC 220 module are as below:

    APC220 Arduino connection

    As shown in the figure, the connections are simple since I just wanted to perform a simple test to see whether the module is working fine:

    APC 220 Arduino Blink

    Below are the codes. You are free to change the serial baud number, I used 57600. Once the codes were uploaded to your Arduino board,

    1. connect everything,
    2. pop in the Serial Monitor on your Arduino IDE console,
    3. choose the respective baud (mine is 57600),
    4. send capital H to the console, observe the LED is turned on,
    5. send other character e.g. i to the console, observe the LED is turned off.

    Happy coding!

    // Modified from Arduino Playground tutorial: http://www.arduino.cc/playground/Learning/Tutorial01
    char val; // variable to receive data from the serial port
    int ledpin = 13; // LED connected to pin 13 (on-board LED)
    
    void setup() {
      pinMode(ledpin, OUTPUT);  // pin 13 (built-in LED) as OUTPUT
      Serial.begin(57600);       // start serial communication at 57600bps 
    }
    void loop() {
      if( Serial.available() )       // if data is available to read
      {
        val = Serial.read();         // read it and store it in 'val'
      }
      if( val == 'H' )               // if 'H' was received
      {
        digitalWrite(ledpin, HIGH);  // turn ON the LED
      } else { 
        digitalWrite(ledpin, LOW);   // otherwise turn it OFF
      }
      delay(100);                    // wait 100ms for next reading
    }

    [1] I have established a research group named Marine Robotics Research Group. Someday I’ll make some write up for it.

     
    • yusuf rahman 4:52 pm on January 3, 2015 Permalink | Reply

      Salam and hi.

      I’m using apc 220 module to control my diy quadcopter (arduino uno board). I use “serial.print” to read the angle and motor speed of my quadcopter and it works as good as it is.

      My problem is I can’t send the data from computer to arduino to control the quadcopter motor speed at the same time. The computer keep reading data from arduino.

      I use acquirelock() function and send the data.

      My question is do I need “delay()” or “break” function so while the arduino keep sending the data, and then stop a while to receive the data from computer and process it without compromising the quadcopter hovering?

      Or if you have any other idea, I’m happy to hear about it.

      • drahfa 6:58 am on January 12, 2015 Permalink | Reply

        Salam Tn Yusuf,

        I believe you are spot on with the delay function since the signal transfer relies on the baud rate. What is the baud rate that you are currently using?
        For the quadcopter application, my I suggest the use of 3DR Radio? It’s a standard for the Arducopter project using APM board.

        Regards,

        Faisal

  • drahfa 1:59 pm on July 2, 2013 Permalink | Reply  

    How to auto takeoff and auto landing an Arducopter 

    I found some resources that discuss on how to auto takeoff and auto landing an ArduCopter. Click here.

    I’m going to try this and update later.

     
  • drahfa 7:39 am on July 27, 2012 Permalink | Reply
    Tags: , Bentley, COM, Maxsurf   

    Using COM Automation to quick-start Bentley Maxsurf v18 

    The latest version of Maxsurf is Bentley Maxsurf V18i. You can download this version from Formsys and Bentley site, in which you’ll get a 15-days fully functional trial version. Afterwards, you can purchase the license via Bentley Select Licensing. If you’re from Malaysia, you can get the license from Caidmark Sdn Bhd.

    Okay let’s jump into the good stuff. If you are using the Trial Version, you’ll be:

    1. Notified each time by a pop-up which check your license’s status,

    2. clicking the trial button,

    3. clicking the selection of hull and,

    4. finally arrive at the design space.

    An awesome person (like you and me) will definitely automate these actions and go fishing. The step will be shorten to:

    1. Clicking our newly-made programme, and
    2. Voila there goes our design space!

    You’ll be using Autoit V3. Make sure you get familiar with the software (approximate time: 10 minutes). It is basically a programme to automate your action in Windows. However you can also use it to write complex programme. It’s basically based on BASIC programming language. (Wow, 2 puns in one paragraph!)

    1. First, you’ll need to copy-paste the codes below. Take note that the path of my Bentley Maxsurf is default.

    2. Save it somewhere in a folder (not in the desktop, Windows permission doesn’t like this behaviour, Windows will probably kill your cat).

    3. Compile it to EXE (using AutoIt compile function)

    ; Maxsurf Start
    ; by: Dr. Ahmad Faisal Mohamad Ayob
    ; 21 July 2012
    
    ; Initiate COM object of Maxsurf within our programme
    $oMaxsurf = ObjCreate("Maxsurf.Application")
    
    ; Run EXE path of Maxsurf Modeler Advanced 64 bit
    Run ("C:Program FilesBentleyEngineeringMaxsurf 18 V8iMaxsurfModelerAdvanced64.exe")
    
    ; Wait for Licensing Options -> Choose default (Trial) and send {Enter}
    WinWaitActive("No License Found")
    Send ("{ENTER}")
    
    ; Wait for Maxsurf Quick Start hull options and send {ESC} to invoke the default design space
    WinWaitActive("Maxsurf Professional Quick Start")
    Send("{ESC}")
    

    Voila! You’ve just finished your first automation programme! (Well technically it’s mine, but I gave it to you, you’re welcome).

    What we are expecting is, once you clicked your programme, it will do all the clickity-clack above and brings you the design space.

    Happy coding!

    p/s: You want to have the final compiled EXE? Grab it here.

     
c
Compose new post
j
Next post/Next comment
k
Previous post/Previous comment
r
Reply
e
Edit
o
Show/Hide comments
t
Go to top
l
Go to login
h
Show/Hide help
shift + esc
Cancel