CategoriesUncategorized

Micro:Bit Week 2, Day 4

Extension Link

https://github.com/jhlucky/maqueen

Code

radio.onReceivedNumber(function (receivedNumber) {

    if (radio.receivedPacket(RadioPacketProperty.SignalStrength) > -47) {

        health = health - 1

    }

})

input.onButtonPressed(Button.A, function () {

    basic.showNumber(health)

})

input.onButtonPressed(Button.AB, function () {

    health = 5

})

let health = 0

radio.setGroup(1)

health = 10

basic.forever(function () {

    if (health > 5) {

        basic.showIcon(IconNames.Heart)

    } else if (health > 0) {

        basic.showIcon(IconNames.Sad)

        radio.sendNumber(1)

        basic.pause(1000)

    } else {

        basic.showIcon(IconNames.Ghost)

        maqueen.motorStopAll()

    }

    if (maqueen.sensor(PingUnit.Centimeters) < 30 && health > 0) {

        if (Math.randomBoolean()) {

            maqueen.MotorRun(maqueen.aMotors.M1, maqueen.Dir.CCW, 125)

maqueen.MotorRun(maqueen.aMotors.M2, maqueen.Dir.CW, 125)

        } else {

            maqueen.MotorRun(maqueen.aMotors.M1, maqueen.Dir.CW, 125)

maqueen.MotorRun(maqueen.aMotors.M2, maqueen.Dir.CCW, 125)

        }

        basic.pause(250)

    } else if (health > 0) {

        maqueen.MotorRun(maqueen.aMotors.M1, maqueen.Dir.CW, health * 25)

maqueen.MotorRun(maqueen.aMotors.M2, maqueen.Dir.CW, health * 25)

    }

})
CategoriesUncategorized

Micro:Bit Week 2, Day 2

radio.onReceivedNumber(function (receivedNumber) {
    if (receivedNumber == 0) {
        if (maqueen.sensor(PingUnit.Centimeters) < 30) {
            if (Math.randomBoolean()) {
                maqueen.MotorRun(maqueen.aMotors.M1, maqueen.Dir.CW, 127)
maqueen.MotorRun(maqueen.aMotors.M2, maqueen.Dir.CCW, 127)
            } else {
                maqueen.MotorRun(maqueen.aMotors.M1, maqueen.Dir.CCW, 127)
maqueen.MotorRun(maqueen.aMotors.M2, maqueen.Dir.CW, 127)
            }
            basic.pause(500)
        } else {
            maqueen.MotorRun(maqueen.aMotors.M1, maqueen.Dir.CW, 255)
maqueen.MotorRun(maqueen.aMotors.M2, maqueen.Dir.CW, 255)
        }
        basic.showArrow(ArrowNames.North)
    } else if (receivedNumber == 1) {
        maqueen.MotorRun(maqueen.aMotors.M1, maqueen.Dir.CW, 127)
maqueen.MotorRun(maqueen.aMotors.M2, maqueen.Dir.CCW, 127)
basic.showArrow(ArrowNames.East)
    } else if (receivedNumber == 3) {
        maqueen.MotorRun(maqueen.aMotors.M1, maqueen.Dir.CCW, 127)
maqueen.MotorRun(maqueen.aMotors.M2, maqueen.Dir.CW, 127)
basic.showArrow(ArrowNames.West)
    } else if (receivedNumber == 2) {
        maqueen.MotorRun(maqueen.aMotors.M1, maqueen.Dir.CCW, 255)
maqueen.MotorRun(maqueen.aMotors.M2, maqueen.Dir.CCW, 255)
basic.showArrow(ArrowNames.South)
    } else if (receivedNumber == 4) {
        maqueen.motorStopAll()
        basic.clearScreen()
    }
})
radio.setGroup(1)
basic.forever(function () {
    
})
CategoriesUncategorized

Micro:Bit Week 2, Day 1

Add Extension in MakeCode

https://github.com/jhlucky/maqueen

Receiver

radio.onReceivedNumber(function (receivedNumber) {
    if (receivedNumber == 0) {
        maqueen.MotorRun(maqueen.aMotors.M1, maqueen.Dir.CW, 255)
        maqueen.MotorRun(maqueen.aMotors.M2, maqueen.Dir.CW, 255)
        basic.showArrow(ArrowNames.North)
    } else if (receivedNumber == 1) {
        maqueen.MotorRun(maqueen.aMotors.M1, maqueen.Dir.CW, 127)
        maqueen.MotorRun(maqueen.aMotors.M2, maqueen.Dir.CCW, 127)
        basic.showArrow(ArrowNames.East)
    } else if (receivedNumber == 3) {
        maqueen.MotorRun(maqueen.aMotors.M1, maqueen.Dir.CCW, 127)
        maqueen.MotorRun(maqueen.aMotors.M2, maqueen.Dir.CW, 127)
        basic.showArrow(ArrowNames.West)
    } else if (receivedNumber == 2) {
        maqueen.MotorRun(maqueen.aMotors.M1, maqueen.Dir.CCW, 255)
        maqueen.MotorRun(maqueen.aMotors.M2, maqueen.Dir.CCW, 255)
        basic.showArrow(ArrowNames.South)
    } else if (receivedNumber == 4) {
        maqueen.motorStopAll()
        basic.clearScreen()
    }
})
radio.setGroup(1)
basic.forever(function () {
	
})

Sender

input.onGesture(Gesture.Shake, function () {
	
})
radio.setGroup(1)
basic.forever(function () {
    if (input.isGesture(Gesture.LogoDown)) {
        radio.sendNumber(0)
        basic.showArrow(ArrowNames.North)
    } else if (input.isGesture(Gesture.TiltRight)) {
        radio.sendNumber(1)
        basic.showArrow(ArrowNames.East)
    } else if (input.isGesture(Gesture.LogoUp)) {
        radio.sendNumber(2)
        basic.showArrow(ArrowNames.South)
    } else if (input.isGesture(Gesture.TiltLeft)) {
        radio.sendNumber(3)
        basic.showArrow(ArrowNames.West)
    } else {
        radio.sendNumber(4)
        basic.clearScreen()
    }
})
CategoriesOffice Space

Switching away from SkyDrive

I loved it for long, as I received the 25GB upgrade and it worked like a charm across all OSes and systems. Along came Windows 8.1 and since then, server syncs never happen easily and directly.

Files are attempted to be synced on my laptop for hours over WiFi, draining the battery in the background. So long, it’s been fun – but others focusing on just syncing have it implemented and continuously working way better.

CategoriesOffice Space

IEEE EIT 2013 in Rapid City, SD

At the 2013 IEEE EIT conference in Rapid City, SD, USA, presenting two papers:

Junghyo  Lee and P. Seeling. An Overview of Mobile Device Network Traffic and Network Interface Usage Patterns.  In Proceedings of the IEEE International Conference on Electro/Information  Technology (EIT), Rapid City, SD, USA, May 2013.

Christopher Sulisz, Troy Johnson, and P. Seeling.  Video Characteristics of Mobile Videos on Android Devices: Initial Results. In Proceedings of the IEEE International Conference on Electro/Information Technology (EIT) , Rapid City, SD, USA, May 2013.

CategoriesOffice Space

Thanks Blackboard!

And again, LMS systems at their worst: When I randomize a set of questions, I cannot get statistics in the actual BlackBoard system…why?

Had to go and quickly hack something together for assessment – here it is, export in the long format and run…

[code lang=”perl”]
#!perl
use strict;
use warnings;
# "Username","Last Name","First Name","Question ID","Question","Answer","Possible Points","Auto Score","Manual Score"
open(IN, "<Final.downloadlong.csv") or die;
while (<IN>) {
chomp;
my @line = split ",";
next if $line[0] eq "Username";
$line[0] =~ s/"//gi;
$line[0] =~ s/s//gi;
$line[3] =~ s/"//gi;
$line[3] =~ s/[Question ID]//gi;
$line[3] =~ s/s//gi;

$line[$#line-1] =~ s/"//gi;
$line[$#line] =~ s/"//gi;

my $points = $line[$#line-1];
if ($line[$#line] ne "") {
$points = $line[$#line];
}

my $uname= $line[0];
my $question = $line[3];

print "$uname, $question, $pointsn";

}
close(IN);

[/code]