Jump to content

AndyD273

Members
  • Content Count

    5
  • Joined

  • Last visited


Reputation Activity

  1. Like
    AndyD273 reacted to Rickta59 in Using Energia with MSP430G2231   
    Here is a version written with fabooh. https://github.com/RickKimball/fabooh
     

    /* * andyd273.cpp - simple fabooh msp430g2231 program to turn on a relay for 10 seconds * when the user button on the launchpad is pressed * * Created on: Feb 13th, 2017 * Author: kimballr * Pinout: * P1.3 is button on launchpad board * P1.6 is relay output (also lights led) */ #include <fabooh.h> #define SMALL_INIT4 /* don't initialize .bss and .data sections */ #include <main.h> #include <serial.h> namespace { const uint32_t BAUD_RATE=9600; typedef serial_default_t<BAUD_RATE, CPU::frequency, TX_PIN, NO_PIN> serial; serial Serial; } void setup() { PUSH2::set_mode(INPUT_PULLUP); P1_6::set_mode(OUTPUT); P1_6::low(); Serial.begin(); } void loop() { for (; { int n = 1; do (PUSH2::read()) ? --n : (n = 5000); while (n); do (PUSH2::read()) ? n = 5000 : --n; while (n); Serial << "turning on relay\r\n"; P1_6::high(); Serial << "wait 10 seconds\r\n"; delay(10000); Serial << "turning off relay\r\n"; P1_6::low(); } }   
    I've included a compiled version of this so you can just load it on the msp430g2231 launchpad.
    Use the mspdebug command to load it (Find mspdebug.exe someplace in the Energia install tree on your hard disk)
     
    C:\ mspdebug rf2500 "prog andyd273.hex"
     
    rename this file to andyd273.hex
    andyd273.txt
×
×
  • Create New...