CircuitGizmos

Electronic Products for Creative Minds

  • Home
  • Gizmo Store/Products
  • Documentation/Datasheets
  • Projects/Libraries
  • GizmoBlog
  • Services/Contact
    • Design
    • Contact Gizmo!
  • Your Gizmo Cart
    • Your Account

February 8, 2009 by robert Leave a Comment

Shortest RobotBASIC program for U401

How easy is it to program the U401 with RobotBASIC? The version of RobotBASIC that supports the USBmicro U401 and U421 will be released soon. I have a pre-release version and in an attempt to show how easy it is to control the U401 (or U421), I made the code below:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<span style="color: #008000;">//---------------------------------------------------------------------------
//
// Main Program
//
//---------------------------------------------------------------------------
 
MainProgram:
 
    //---------------------------
    // Discover the devices
    //---------------------------
    n = usbm_finddevices()
 
    // Set dir of port A of dev 0 to out
    n = usbm_DirectionA(0, 255, 255)
 
    // Turn on all the port's outputs
    n = usbm_WriteA(0, 255)
 
End
</span>

I’ll admit: This doesn’t do much that is exciting. With something connected to the port of the U401/U421, this code turned it on. Perhaps it is just an indicator LED, or a relay that turns on a light or a motor, but the point is it is not difficult at all to add support in a RobotBASIC program to affect some real-world hardware.

So. To imitate several big companies with their catch phrases:

“What will you turn on, today?”

Perhaps I should rethink that… or perhaps not. 🙂

Filed Under: Uncategorized Tagged With: programming, RobotBASIC, u401, u421

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

A Ton of Documentation

Open all | Close all

Projects made by Gizmo, Friends, and Members

open all | close all

Recent GizmoBlog Musings

  • Altair 8800 using a ColorMax!
  • Re-energizing the ColorMax, Pt. 3

Visit us!

  • Facebook

Electronic Products for Creative Minds

CircuitGizmos is your source for electronic products that help you create your embedded projects. Here at CircuitGizmos.com you will find a friendly store filled with creative products and all of the documentation that you need to use these gizmos.

We create devices that we believe make electronics fun, but we also know that our products are used for professional designs. For decades we have designed products for commercial, military, and medical industries. Our gizmos here are great for engineers and hobbyists alike.

Copyright © 2008+ CircuitGizmos, L.L.C. All rights reserved

Image already added

Recently Viewed Products

Copyright © 2021 · Generate Pro Theme on Genesis Framework · WordPress · Log in