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
You are here: Home / GizmoBlog / MMBasic Language / Input and Output / PIN

PIN

PIN( pin ) = value

For a ‘pin’ configured as digital output this will set the output to low (‘value’ is zero) or high (‘value’ non zero). You can set an output high or low before it is configured as an output and that setting will be the default output when the SETPIN command takes effect.

‘pin’ zero is a special case and will always control the LED on the front panel. A ‘value’ of non zero will turn the LED on, or zero for off.

PIN( pin )

PIN returns the value on the external I/O ‘pin’. Zero means digital low, 1 means digital high and for analog inputs it will return the measured voltage as a floating point number.

Frequency inputs will return the frequency in Hz (maximum 200KHz). A period input will return the period in milliseconds while a count input will return the count since reset (counting is done on the positive rising edge). The count input can be reset to zero by resetting the pin to counting input (even if it is already so configured).

‘pin’ zero is a special case which will always return the state of the bootload push button on the PC board (non zero means that the button is down).

See also:
PORT
PULSE
PWM
PWM STOP
SETPIN

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 © 2025 · Generate Pro Theme on Genesis Framework · WordPress · Log in