28 March 2021

Scaffolding: Progress Review

 The controller I decided to go with is a very simple control that will match the very simplistic mechanics of Rise of Nations. To move the cursor all you need to do is touch the four touch sensors on the Circuit playground express, they are in this case A1, A2, A3, and A4. I will be using the accelerometer to mimic the scroll wheel of a mouse so a user can still zoom in and out of it. The buttons will be capacitor sensors that will be made on two other portions of the CPE.


1. How Can I improve my codes functionality?
2. Is there a way to make this more efficient?






//Load CPE FILES

M=mouse;
While True(
if A5 pressed(
m.press (mouse.A5)
m.release (mouse.A5))
);
if A6 pressed(
m.press (mouse.A6)
m.release (mouse.A6))
);

while True(
    if touch_A4(
        m.move(-1, 0, 0));
    if touch_A3(
        m.move(1, 0, 0));
    if touch_A2(
        m.move(0, -1, 0));
    if touch_A1(
        m.move(0, 1, 0));

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.