docs

a slatepencil documentail site

View on GitHub

ARDUINO IOT EXPERIMENTS

IO Port Configuration (Embedded Software and Hardware Architecture)

PxDIR Register

PxOUT Register

#include <stdint.h>
#include "msp.h"

// MSP432 microcontroller
#define LENGHT1 (100000)
#define LENGTH2 (10000)
#define P1_OUT_REG (0x40004C02)
#define P1_DIR_REG (0x40004C04)
#define BIT0 (0x01)

void main(void)
{
  uint32_t i;
  uint8_t * p1_out = (uint8_t*)0x40004c02; /* pointer to port 1 output register */
  uint8_t * p1_dir = (uint8_t*)P1_DIR_REG; /* pointer to port 1 direction register */

  /* Stop watchdog timer */
  WDTCTL = WDTPW | WDTHOLD;

  /* Sturcture overlay: Configure P1.0 as output */
  // P1 -> DIR |= 0x01;
  /* Direct Dereference: Configure P1.0 as output */
  *p1_dir |= BIT0;
  while(1)
  {
    /* Direct Dereference: Set P1.0 HIGH */
    // P1 -> OUT |= BIT0;

    /* Structure Overlay: Toggle P1.0 */
    // P1 -> OUT ^= 0x01;
    /* Direct Dereference: Toggle P1.0 */
    *p1_out ^= BIT0;

    for (i = LENGHT1; i>0; i--); /* Delay */
  }
}

Special ports

Sensor Experiments

car experiments

iot experiments

type

constants

functions

main

/**
put your setup code here, to run once, to init
 */
void setup() {}

/**
put your main code here, to run repeatedly:
 */
void loop() {}

macos arduino IDE library path

/Users/<username>/Library/Arduino15/libraries

Platform arduino:avr@1.8.6 already installed
Already installed LiquidCrystal@1.0.7
Already installed Mouse@1.0.1
Already installed Arduino_BuiltIn@1.0.0
Already installed Ethernet@2.0.1
Already installed Stepper@1.1.3
Already installed Firmata@2.5.9
Already installed Keyboard@1.0.4
Downloading Servo@1.1.8
Servo@1.1.8
Installing Servo@1.1.8
Installed Servo@1.1.8
Downloading SD@1.2.4
SD@1.2.4
Installing SD@1.2.4
Installed SD@1.2.4
Downloading TFT@1.0.6
TFT@1.0.6
Installing TFT@1.0.6
Installed TFT@1.0.6

linux connection

ls -l /dev/ttyACM*
crw-rw---- 1 root dialout 188, 0 5 apr 23.01 ttyACM0
sudo usermod -a -G dialout <username>
Downloading packages
arduino:avr-gcc@7.3.0-atmel3.6.1-arduino7
arduino:avrdude@6.3.0-arduino17
arduino:arduinoOTA@1.3.0
arduino:avr@1.8.6
Installing arduino:avr-gcc@7.3.0-atmel3.6.1-arduino7
arduino:avr-gcc@7.3.0-atmel3.6.1-arduino7 installed
Installing arduino:avrdude@6.3.0-arduino17
arduino:avrdude@6.3.0-arduino17 installed
Installing arduino:arduinoOTA@1.3.0
arduino:arduinoOTA@1.3.0 installed
Installing platform arduino:avr@1.8.6
Configuring platform.
Platform arduino:avr@1.8.6 installed
Downloading Ethernet@2.0.1
Ethernet@2.0.1
Installing Ethernet@2.0.1
Installed Ethernet@2.0.1
Downloading Firmata@2.5.9
Firmata@2.5.9
Installing Firmata@2.5.9
Installed Firmata@2.5.9
Downloading Keyboard@1.0.4
Keyboard@1.0.4
Installing Keyboard@1.0.4
Installed Keyboard@1.0.4
Downloading LiquidCrystal@1.0.7
LiquidCrystal@1.0.7
Installing LiquidCrystal@1.0.7
Installed LiquidCrystal@1.0.7
Downloading Mouse@1.0.1
Mouse@1.0.1
Installing Mouse@1.0.1
Installed Mouse@1.0.1
Downloading Servo@1.1.8
Servo@1.1.8
Installing Servo@1.1.8
Installed Servo@1.1.8
Downloading Stepper@1.1.3
Stepper@1.1.3
Installing Stepper@1.1.3
Installed Stepper@1.1.3
Downloading Arduino_BuiltIn@1.0.0
Arduino_BuiltIn@1.0.0
Installing Arduino_BuiltIn@1.0.0
Installed Arduino_BuiltIn@1.0.0
Downloading SD@1.2.4
SD@1.2.4
Installing SD@1.2.4
Installed SD@1.2.4
Downloading TFT@1.0.6
TFT@1.0.6
Installing TFT@1.0.6
Installed TFT@1.0.6

Windows 11 connection

Downloading packages
arduino:avr-gcc@7.3.0-atmel3.6.1-arduino7
arduino:avrdude@6.3.0-arduino17
arduino:arduinoOTA@1.3.0
arduino:avr@1.8.6
Installing arduino:avr-gcc@7.3.0-atmel3.6.1-arduino7
Configuring tool.
arduino:avr-gcc@7.3.0-atmel3.6.1-arduino7 installed
Installing arduino:avrdude@6.3.0-arduino17
Configuring tool.
arduino:avrdude@6.3.0-arduino17 installed
Installing arduino:arduinoOTA@1.3.0
Configuring tool.
arduino:arduinoOTA@1.3.0 installed
Installing platform arduino:avr@1.8.6
Configuring platform.
Platform arduino:avr@1.8.6 installed
Downloading Arduino_BuiltIn@1.0.0
Arduino_BuiltIn@1.0.0
Installing Arduino_BuiltIn@1.0.0
Installed Arduino_BuiltIn@1.0.0
Downloading Ethernet@2.0.2
Ethernet@2.0.2
Installing Ethernet@2.0.2
Installed Ethernet@2.0.2
Downloading Mouse@1.0.1
Mouse@1.0.1
Installing Mouse@1.0.1
Installed Mouse@1.0.1
Downloading TFT@1.0.6
TFT@1.0.6
Installing TFT@1.0.6
Installed TFT@1.0.6
Downloading Keyboard@1.0.4
Keyboard@1.0.4
Installing Keyboard@1.0.4
Installed Keyboard@1.0.4
Downloading LiquidCrystal@1.0.7
LiquidCrystal@1.0.7
Installing LiquidCrystal@1.0.7
Installed LiquidCrystal@1.0.7
Downloading Stepper@1.1.3
Stepper@1.1.3
Installing Stepper@1.1.3
Installed Stepper@1.1.3
Downloading Firmata@2.5.9
Firmata@2.5.9
Installing Firmata@2.5.9
Installed Firmata@2.5.9
Downloading SD@1.2.4
SD@1.2.4
Installing SD@1.2.4
Installed SD@1.2.4
Downloading Servo@1.1.8
Servo@1.1.8
Installing Servo@1.1.8
Installed Servo@1.1.8