The Alpha Geek – Geeking Out

Adafruit

Project #23: E-Textiles – MicroSD Card – Mk07

——

#DonLucElectronics #DonLuc #ETextiles #Wearable #FLORA #BME280 #CCS811 #RTC #SD #Arduino #Project #Programming #Electronics #Microcontrollers #Consultant

——

MicroSD Card

——

MicroSD Card

——

MicroSD Card

——

MicroSD Card Breakout Board+

Not just a simple breakout board, this microSD adapter goes the extra mile designed for ease of use.

  • Onboard 5 Volt – 3 Volt regulator provides 150mA for power-hungry cards.
  • 3 Volt level shifting means you can use this with ease on either 3 Volt or 5 Volt systems.
  • Uses a proper level shifting chip, not resistors, less problems, and faster read/write access.
  • Use 3 or 4 digital pins to read and write 8 Gb of storage.
  • Activity LED lights up when the SD card is being read or written.
  • Push-push socket with card slightly over the edge of the PCB so its easy to insert and remove.
  • Comes with 0.1″ header, unattached, so you can get it on a breadboard or use wires your choice.

To use with an Arduino, connect GND to ground, 5 Volt – 3 Volt to 5 Volt – 3 Volt, CLK to pin 13, DO to pin 12, DI to pin 11, and CS to pin 10. Then you can use the Arduino IDE’s SD library which supports FAT and FAT32 SD cards.

DL2205Mk01

1 x FLORA – Version 1.0a
1 x SparkFun Environmental Combo CCS811/BME280
1 x DS3231 Precision RTC FeatherWing
1 x MicroSD card breakout board+
1 x MicroSD card 8 Gb
1 x CR1220 Coin Cell Battery
1 x LED Red
1 x 220 Ohm
1 x SparkFun Cerberus USB Cable

FLORA – Version 1.0a

CLK – ICSP 3
DO – ICSP 1
DI – ICSP 4
CS – Digital 10
LER – Digital 6
SCL – Digital 3
SDA – Digital 2
VIN – +5V
VIN – +3.3V
GND – GND

——

DL2205Mk01p.ino

/* ***** Don Luc Electronics © *****
Software Version Information
Project #23: E-Textiles - MicroSD Card - Mk07
23-07
DL2205Mk01p.ino
1 x FLORA - Version 1.0a
1 x SparkFun Environmental Combo CCS811/BME280
1 x DS3231 Precision RTC FeatherWing
1 x MicroSD card breakout board+
1 x MicroSD card 8 Gb
1 x CR1220 Coin Cell Battery
1 x LED Red
1 x 220 Ohm
1 x SparkFun Cerberus USB Cable
*/

// Include the Library Code
// Wire
#include <Wire.h>
// SparkFun BME280 - Humidity, Temperature, Altitude and Barometric Pressure
#include <SparkFunBME280.h>
// SparkFun CCS811 - eCO2 & tVOC
#include <SparkFunCCS811.h>
// Date and time DS3231 RTC
#include <RTClib.h>
// Serial Peripheral Interface (SPI)
#include <SPI.h>
// Secure Digital (SD Card)
#include <SD.h>

// SparkFun BME280 - Temperature, Humidity, Altitude and Barometric Pressure
BME280 myBME280;
// Temperature Celsius
float BMEtempC = 0;
// Humidity
float BMEhumid = 0;
// Altitude Meters
float BMEaltitudeM = 0;
// Barometric Pressure
float BMEpressure = 0;

// SparkFun CCS811 - eCO2 & tVOC
// Default I2C Address
#define CCS811_ADDR 0x5B 
CCS811 myCCS811(CCS811_ADDR);
// eCO2
float CCS811CO2 = 0;
// TVOC
float CCS811TVOC = 0;

// Date and time functions using a DS3231 RTC
RTC_DS3231 RTC;
String sDate;
String sTime;

// Secure Digital (SD Card)
const int chipSelect = 10;
String zzzzzz = "";

// LED Red
const int iLEDR = 6;

// Software Version Information
String sver = "23-07";

void loop() {

  // SparkFun BME280 - Temperature, Humidity, Altitude and Barometric Pressure
  isBME280();

  // SparkFun CCS811 - eCO2 & tVOC
  isCCS811();

  // Dates and Time
  timeRTC();

  // MicroSD Card
  isSD();

  // 1 Seconds
  delay( 1000 );

}

getBME280.ino

// SparkFun BME280 - Temperature, Humidity, Altitude and Barometric Pressure
// isBME280 - Temperature, Humidity, Altitude and Barometric Pressure
void isBME280(){

  // Temperature Celsius
  BMEtempC = myBME280.readTempC();
  // Humidity
  BMEhumid = myBME280.readFloatHumidity() ;
  // Altitude Meters
  BMEaltitudeM = myBME280.readFloatAltitudeMeters();
  // Barometric Pressure
  BMEpressure = myBME280.readFloatPressure();
  
}

getCCS811.ino

// CCS811 - eCO2 & tVOC
// isCCS811 - eCO2 & tVOC
void isCCS811(){

  // This sends the temperature & humidity data to the CCS811
  myCCS811.setEnvironmentalData(BMEhumid, BMEtempC);

  // Calling this function updates the global tVOC and eCO2 variables
  myCCS811.readAlgorithmResults();

  // eCO2 Concentration
  CCS811CO2 = myCCS811.getCO2();
  
  // tVOC Concentration
  CCS811TVOC = myCCS811.getTVOC();
  
}

getRTCDS3231.ino

// DS3231 Precision RTC
// Setup RTC
void setupRTC() {

  // DS3231 Precision RTC   
  RTC.begin();
  if (! RTC.begin()) {
    
    while (1);
    
  }
  
  DateTime now = RTC.now();

  if (RTC.lostPower()) {
    
    // Following line sets the RTC to the date & time this sketch was compiled
    RTC.adjust(DateTime(F(__DATE__), F(__TIME__)));
    // This line sets the RTC with an explicit date & time, for example to set
    // August 2, 2021 at 13:53:0 you would call:
    // RTC.adjust(DateTime(2022, 4, 26, 11, 39, 0));
    
  }
  
}
// timeRTC
void timeRTC() {

    // DS3231 Precision RTC
    sDate = "";
    sTime = "";
    // Date Time
    DateTime now = RTC.now();

    // sData
    sDate += String(now.year(), DEC);
    sDate += "/";
    sDate += String(now.month(), DEC);
    sDate += "/";
    sDate += String(now.day(), DEC);
  
    // sTime
    sTime += String(now.hour(), DEC);
    sTime += ":";
    sTime += String(now.minute(), DEC);
    sTime += ":";
    sTime += String(now.second(), DEC);

}

getSD.ino

// MicroSD Card
// MicroSD Setup
void setupSD() {

    // MicroSD Card
   // See if the card is present and can be initialized:
  if (!SD.begin(chipSelect)) {

    // Don't do anything more:
    while (1);
    
  }

}
// MicroSD Card
void isSD() {

  zzzzzz = "";

  // Version|Date|Time|Temperature Celsius|Humidity|Altitude Meters|Barometric Pressure
  //|eCO2 Concentration|tVOC Concentration|
  zzzzzz = sver + "|" + sDate + "|" + sTime + "|" 
  + BMEtempC + "|" + BMEhumid + "|" + BMEaltitudeM + "|" + BMEpressure + "|"
  + CCS811CO2 + "|" + CCS811TVOC + "|";

  // Open the file. Note that only one file can be open at a time,
  // so you have to close this one before opening another.
  File dataFile = SD.open("DLE22Log.txt", FILE_WRITE);

  // If the file is available, write to it:
  if (dataFile) {
    
    // Write
    dataFile.println( zzzzzz );
    dataFile.close();

  }

}

setup.ino

// Setup
void setup() {

  // Delay
  delay( 100 );
  
  // Set up I2C bus
  Wire.begin();

  // Delay
  delay( 50 );

  // SparkFun BME280 - Temperature, Humidity, Altitude and Barometric Pressure
  myBME280.begin();

  // CCS811 - eCO2 & tVOC
  myCCS811.begin();

  // Setup RTC
  setupRTC();

  //MicroSD Card
  setupSD();

  // LED Red
  pinMode( iLEDR , OUTPUT);
  // Turn the LED Red on HIGH
  digitalWrite( iLEDR , HIGH);

}

——

People can contact us: https://www.donluc.com/?page_id=1927

Technology Experience

  • Single-Board Microcontrollers (PIC, Arduino, Raspberry Pi,Espressif, etc…)
  • IoT
  • Robotics
  • Camera and Video Capture Receiver Stationary, Wheel/Tank and Underwater Vehicle
  • Unmanned Vehicles Terrestrial and Marine
  • Research & Development (R & D)

Instructor and E-Mentor

  • IoT
  • PIC Microcontrollers
  • Arduino
  • Raspberry Pi
  • Espressif
  • Robotics

Follow Us

J. Luc Paquin – Curriculum Vitae – 2022 English & Español
https://www.jlpconsultants.com/luc/

Web: https://www.donluc.com/
Web: https://www.jlpconsultants.com/
Facebook: https://www.facebook.com/neosteam.labs.9/
YouTube: https://www.youtube.com/channel/UC5eRjrGn1CqkkGfZy0jxEdA
Twitter: https://twitter.com/labs_steam
Pinterest: https://www.pinterest.com/NeoSteamLabs/
Instagram: https://www.instagram.com/neosteamlabs/

Don Luc

Project #23: E-Textiles – DS3231 Precision RTC – Mk06

——

#DonLucElectronics #DonLuc #ETextiles #Wearable #FLORA #MicroOLED #BME280 #CCS811 #RTC #Arduino #Project #Programming #Electronics #Microcontrollers #Consultant

——

DS3231 Precision RTC

——

DS3231 Precision RTC

——

DS3231 Precision RTC

——

DS3231 Precision RTC FeatherWing

A Feather board without ambition is a Feather board without FeatherWings. This is the DS3231 Precision RTC FeatherWing it adds an extremely accurate I2C-integrated Real Time Clock (RTC) with a Temperature Compensated Crystal Oscillator (TCXO). This RTC is the most precise you can get in a small, low power package.

Most RTCs use an external 32kHz timing crystal that is used to keep time with low current draw. And that’s all well and good, but those crystals have slight drift, particularly when the temperature changes, the temperature changes the oscillation frequency very very very slightly but it does add up. This RTC is in a beefy package because the crystal is inside the chip, and right next to the integrated crystal is a temperature sensor. That sensor compensates for the frequency changes by adding or removing clock ticks so that the timekeeping stays on schedule.

With a CR1220 12mm coin cell plugged into the top of the FeatherWing, you can get years of precision time keeping, even when main power is lost. Great for datalogging and clocks or anything where you need to really know the time.

DL2204Mk06

1 x FLORA – Version 1.0a
1 x SparkFun Micro OLED
1 x SparkFun Environmental Combo CCS811/BME280
1 x DS3231 Precision RTC FeatherWing
1 x CR1220 Coin Cell Battery
1 x RGB Smart NeoPixel
1 x Half-Size Breadboard
1 x SparkFun Cerberus USB Cable

FLORA – Version 1.0a

SDA – Digital 2
SCL – Digital 3
NEO – Digital 6
VIN – +5V
GND – GND

——

DL2204Mk06p.ino

/* ***** Don Luc Electronics © *****
Software Version Information
Project #23: E-Textiles - DS3231 Precision RTC - Mk06
23-06
DL2204Mk06p.ino
1 x FLORA - Version 1.0a
1 x SparkFun Micro OLED
1 x SparkFun Environmental Combo CCS811/BME280
1 x DS3231 Precision RTC FeatherWing
1 x CR1220 Coin Cell Battery
1 x RGB Smart NeoPixel
1 x Half-Size Breadboard
1 x SparkFun Cerberus USB Cable
*/

// Include the Library Code
// Wire
#include <Wire.h>
// NeoPixels
#include <Adafruit_NeoPixel.h>
// SparkFun Micro OLED
#include <SFE_MicroOLED.h>
// SparkFun BME280 - Humidity, Temperature, Altitude and Barometric Pressure
#include <SparkFunBME280.h>
// SparkFun CCS811 - eCO2 & tVOC
#include <SparkFunCCS811.h>
// Date and time DS3231 RTC
#include <RTClib.h>

// NeoPixels
// On digital pin 6
#define PIN 6
// NeoPixels NUMPIXELS = 1
#define NUMPIXELS 1
// Pixels
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
// Red
int red = 0;
// Green
int green = 0;
// Blue
int blue = 0;
// Neopix
int iNeo = 0;
// Value
int zz = 0;

// SparkFun Micro OLED
#define PIN_RESET 9
#define DC_JUMPER 1
// I2C declaration
MicroOLED oled(PIN_RESET, DC_JUMPER);

// SparkFun BME280 - Temperature, Humidity, Altitude and Barometric Pressure
BME280 myBME280;
// Temperature Celsius
float BMEtempC = 0;
// Humidity
float BMEhumid = 0;
// Altitude Meters
float BMEaltitudeM = 0;
// Barometric Pressure
float BMEpressure = 0;

// SparkFun CCS811 - eCO2 & tVOC
// Default I2C Address
#define CCS811_ADDR 0x5B 
CCS811 myCCS811(CCS811_ADDR);
// eCO2
float CCS811CO2 = 0;
// TVOC
float CCS811TVOC = 0;

// Date and time functions using a DS3231 RTC
RTC_DS3231 RTC;
String sDate;
String sTime;

// Software Version Information
String sver = "23-06";

void loop() {

  // SparkFun BME280 - Temperature, Humidity, Altitude and Barometric Pressure
  isBME280();

  // SparkFun CCS811 - eCO2 & tVOC
  isCCS811();

  // FLORA
  isFLORA();

  // Dates and Time
  timeRTC();

  // Micro OLED
  isMicroOLED();
 
}

getBME280.ino

// SparkFun BME280 - Temperature, Humidity, Altitude and Barometric Pressure
// isBME280 - Temperature, Humidity, Altitude and Barometric Pressure
void isBME280(){

  // Temperature Celsius
  BMEtempC = myBME280.readTempC();
  // Humidity
  BMEhumid = myBME280.readFloatHumidity() ;
  // Altitude Meters
  BMEaltitudeM = myBME280.readFloatAltitudeMeters();
  // Barometric Pressure
  BMEpressure = myBME280.readFloatPressure();
  
}

getCCS811.ino

// CCS811 - eCO2 & tVOC
// isCCS811 - eCO2 & tVOC
void isCCS811(){

  // This sends the temperature & humidity data to the CCS811
  myCCS811.setEnvironmentalData(BMEhumid, BMEtempC);

  // Calling this function updates the global tVOC and eCO2 variables
  myCCS811.readAlgorithmResults();

  // eCO2 Concentration
  CCS811CO2 = myCCS811.getCO2();
  
  // tVOC Concentration
  CCS811TVOC = myCCS811.getTVOC();
  
}

getFLORA.ino

// FLORA
// isFLORA
void isFLORA() {

  // FLORA = Temperature Celsius
  // BMEtempC

  // FLORA = Temperature Celsius
  if ( BMEtempC >= 50 ) {

    // 40 <= Temperature Celsius < 50~~~
    zz = 2;
    isNUMPIXELS();

  } else if ( BMEtempC >= 40 ) {

    // 30 <= Temperature Celsius < 40
    zz = 3;
    isNUMPIXELS();
    
  }  else if ( BMEtempC >= 30 ) {

    // 20 <= Temperature Celsius < 30
    zz = 4;
    isNUMPIXELS();
    
  } else if ( BMEtempC >= 20 ) {

    // 10 <= Temperature Celsius < 20
    zz = 0;
    isNUMPIXELS();
    
  } else if ( BMEtempC >= 10 ) {

    // ~~~0 <= Temperature Celsius < 10
    zz = 1;
    isNUMPIXELS();
    
  }
    
}

getMicroOLED.ino

// SparkFun Micro OLED
// Setup Micro OLED
void setupMicroOLED() {

  // Initialize the OLED
  oled.begin();
  // Clear the display's internal memory
  oled.clear(ALL);
  // Display what's in the buffer (splashscreen)
  oled.display();

  // Delay 1000 ms
  delay(1000);

  // Clear the buffer.
  oled.clear(PAGE);
  
}
// Micro OLED
void isMicroOLED() {

  // Text Display BME280
  // Clear the display
  oled.clear(PAGE);
  // Set cursor to top-left
  oled.setCursor(0, 0);
  // Set font to type 0
  oled.setFontType(0);
  // Temperature Celsius
  oled.print("T: ");
  oled.print(BMEtempC, 2);
  oled.setCursor(0, 10);
  // Humidity
  oled.print("H: ");
  oled.print(BMEhumid, 0);
  oled.setCursor(0, 20);
  // Altitude Meters
  oled.print("A: ");
  oled.print(BMEaltitudeM, 1);
  oled.setCursor(0, 30);
  // Barometric Pressure
  oled.print("P: ");
  oled.print(BMEpressure, 0);
  oled.display();

  // Delay
  delay( 2000 );

  // Text Display CCS811
  // Clear the display
  oled.clear(PAGE);
  // Set cursor to top-left
  oled.setCursor(0, 0);
  // Set font to type 0
  oled.setFontType(0);
  // Date
  oled.setCursor(0, 0);
  oled.print(sDate);
  // Time
  oled.setCursor(0, 10);
  oled.print(sTime);
  // eCO2 Concentration
  oled.setCursor(0, 20);
  oled.print("C: ");
  oled.print(CCS811CO2, 0);
  // tVOC Concentration
  oled.setCursor(0, 30);
  oled.print("V: ");
  oled.print(CCS811TVOC, 0);  
  oled.display();

  // Delay
  delay( 2000 );

}

getNeopix.ino

// NeoPixels
// Neopix
void isNeopix() 
{ 

    // Pixels
    pixels.setBrightness( 150 );
    // Pixels color takes RGB values, from 0,0,0 up to 255,255,255
    pixels.setPixelColor( iNeo, pixels.Color(red,green,blue) ); 
    // This sends the updated pixel color to the hardware
    pixels.show(); 
    // Delay for a period of time (in milliseconds)
    delay(50);     
  
}
// isNUMPIXELS
void isNUMPIXELS()
{

  // Neopix Value
  switch ( zz ) {  
    case 0:
      // NeoPixels Green
      // Red
      red = 0;
      // Green
      green = 255;
      // Blue
      blue = 0;
      // Neopix
      iNeo = 0;   
      isNeopix();
      break;  
    case 1:
      // NeoPixels Blue
      // Red
      red = 0;
      // Green
      green = 0;
      // Blue
      blue = 255;
      // Neopix
      iNeo = 0;
      isNeopix();
      break;
    case 2:
      // NeoPixels Red
      // Red
      red = 255;
      // Green
      green = 0;
      // Blue
      blue = 0;
      // Neopix
      iNeo = 0;   
      isNeopix();
      break;
    case 3:
      // NeoPixels Yellow
      // Red
      red = 255;
      // Green
      green = 255;
      // Blue
      blue = 0;
      // Neopix
      iNeo = 0;
      isNeopix();
      break;
    case 4:
      // NeoPixels Magenta
      // Red
      red = 255;
      // Green
      green = 0;
      // Blue
      blue = 255;
      // Neopix
      iNeo = 0;
      isNeopix();
      break;
    case 5:
      // NeoPixels Cyan
      // Red
      red = 0;
      // Green
      green = 255;
      // Blue
      blue = 255;
      // Neopix
      iNeo = 0;
      isNeopix();
      break;
    case 6:
      // NeoPixels White
      // Red
      red = 255;
      // Green
      green = 255;
      // Blue
      blue = 255;
      // Neopix
      iNeo = 0;
      isNeopix();    
      break;
  }
  
}
// isNUMPIXELSoff
void isNUMPIXELSoff()
{

   // Black Off
   // NeoPixels
   // Red
   red = 0;
   // Green
   green = 0;
   // Blue
   blue = 0;
   isNeopix();
 
}

getRTCDS3231.ino

// DS3231 Precision RTC
// Setup RTC
void setupRTC() {

  // DS3231 Precision RTC   
  RTC.begin();
  if (! RTC.begin()) {
    while (1);
  }
  
  DateTime now = RTC.now();

  if (RTC.lostPower()) {
    
    // Following line sets the RTC to the date & time this sketch was compiled
    RTC.adjust(DateTime(F(__DATE__), F(__TIME__)));
    // This line sets the RTC with an explicit date & time, for example to set
    // August 2, 2021 at 13:53:0 you would call:
    // RTC.adjust(DateTime(2022, 4, 26, 11, 39, 0));
    
  }
  
}
// timeRTC
void timeRTC() {

    // DS3231 Precision RTC
    sDate = "";
    sTime = "";
    // Date Time
    DateTime now = RTC.now();

    // sData
    sDate += String(now.year(), DEC);
    sDate += "/";
    sDate += String(now.month(), DEC);
    sDate += "/";
    sDate += String(now.day(), DEC);
  
    // sTime
    sTime += String(now.hour(), DEC);
    sTime += ":";
    sTime += String(now.minute(), DEC);
    sTime += ":";
    sTime += String(now.second(), DEC);

}

setup.ino

// Setup
void setup() {

  // NeoPixels
  // This initializes the NeoPixel library
  pixels.begin();
  // Delay for a period of time (in milliseconds)
  delay(50);
  // isNUMPIXELS Off
  isNUMPIXELSoff();

  // Set up I2C bus
  Wire.begin();

  // Delay for a period of time (in milliseconds)
  delay(50);
  // SparkFun BME280 - Temperature, Humidity, Altitude and Barometric Pressure
  myBME280.begin();

  // CCS811 - eCO2 & tVOC
  myCCS811.begin();

  // Setup RTC
  setupRTC();

  // Setup Micro OLED
  setupMicroOLED();

}

——

People can contact us: https://www.donluc.com/?page_id=1927

Technology Experience

  • Single-Board Microcontrollers (PIC, Arduino, Raspberry Pi,Espressif, etc…)
  • IoT
  • Robotics
  • Camera and Video Capture Receiver Stationary, Wheel/Tank and Underwater Vehicle
  • Unmanned Vehicles Terrestrial and Marine
  • Research & Development (R & D)
  • Desktop Applications (Windows, OSX, Linux, Multi-OS, Multi-Tier, etc…)
  • Mobile Applications (Android, iOS, Blackberry, Windows Mobile, Windows CE, etc…)
  • Web Applications (LAMP, Scripting, Java, ASP, ASP.NET, RoR, Wakanda, etc…)
  • Social Media Programming & Integration (Facebook, Twitter, YouTube, Pinterest, etc…)
  • Content Management Systems (WordPress, Drupal, Joomla, Moodle, etc…)
  • Bulletin Boards (phpBB, SMF, Vanilla, jobberBase, etc…)
  • eCommerce (WooCommerce, OSCommerce, ZenCart, PayPal Shopping Cart, etc…)

Instructor and E-Mentor

  • IoT
  • PIC Microcontrollers
  • Arduino
  • Raspberry Pi
  • Espressif
  • Robotics
  • DOS, Windows, OSX, Linux, iOS, Android, Multi-OS
  • Linux-Apache-PHP-MySQL

Follow Us

J. Luc Paquin – Curriculum Vitae – 2022 English & Español
https://www.jlpconsultants.com/luc/

Web: https://www.donluc.com/
Web: https://www.jlpconsultants.com/
Facebook: https://www.facebook.com/neosteam.labs.9/
YouTube: https://www.youtube.com/channel/UC5eRjrGn1CqkkGfZy0jxEdA
Twitter: https://twitter.com/labs_steam
Pinterest: https://www.pinterest.com/NeoSteamLabs/
Instagram: https://www.instagram.com/neosteamlabs/

Don Luc

Project #23: E-Textiles – ams CCS811 – Mk05

——

#DonLucElectronics #DonLuc #ETextiles #Wearable #FLORA #MicroOLED #BME280 #CCS811 #Arduino #Project #Programming #Electronics #Microcontrollers #Consultant

——

ams CCS811

——

ams CCS811

——

ams CCS811

——

ams CCS811 Ultra-Low Power Digital Gas Sensor for Monitoring Indoor Air Quality

The CCS811 is an ultra-low power digital gas sensor solution which integrates a metal oxide (MOX) gas sensor to detect a wide range of Volatile Organic Compounds (VOCs) for indoor air quality monitoring with a microcontroller unit (MCU), which includes an Analog-to-Digital converter (ADC), and an I²C interface.

CCS811 is based on ams unique micro-hotplate technology which enables a highly reliable solution for gas sensors, very fast cycle times and a significant reduction in average power consumption. The integrated MCU manages the sensor drive modes and raw sensor data measured while detecting VOCs. The I²C digital interface significantly simplifies the hardware and software design, enabling a faster time to market.

CCS811 supports intelligent algorithms to process raw sensor measurements to output a TVOC value or equivalent CO2 (eCO2) levels, where the main cause of VOCs is from humans. CCS811 supports multiple measurement modes that have been optimised for low-power consumption during an active sensor measurement and idle mode extending battery life in portable applications.

Applications

This device can be mainly used for indoor air quality monitoring in:

  • Smartphones
  • Wearables
  • Home and building automation
  • Accessories

DL2204Mk05

1 x FLORA – Version 1.0a
1 x SparkFun Micro OLED
1 x SparkFun Environmental Combo CCS811/BME280
1 x RGB Smart NeoPixel
1 x Half-Size Breadboard
1 x SparkFun Cerberus USB Cable

FLORA – Version 1.0a

NEO – Digital 6
SDA – Analog A2
SCL – Analog A3
VIN – +5V
GND – GND

DL2204Mk05p.ino

/* ***** Don Luc Electronics © *****
Software Version Information
Project #23: E-Textiles - ams CCS811 - Mk05
23-05
DL2204Mk05p.ino
1 x FLORA - Version 1.0a
1 x SparkFun Micro OLED
1 x SparkFun Environmental Combo CCS811/BME280
1 x RGB Smart NeoPixel
1 x Half-Size Breadboard
1 x SparkFun Cerberus USB Cable
*/

// Include the Library Code
// Wire
#include <Wire.h>
// NeoPixels
#include <Adafruit_NeoPixel.h>
// SparkFun Micro OLED
#include <SFE_MicroOLED.h>
// SparkFun BME280 - Humidity, Temperature, Altitude and Barometric Pressure
#include <SparkFunBME280.h>
// SparkFun CCS811 - eCO2 & tVOC
#include <SparkFunCCS811.h>

// NeoPixels
// On digital pin 6
#define PIN 6
// NeoPixels NUMPIXELS = 1
#define NUMPIXELS 1
// Pixels
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
// Red
int red = 0;
// Green
int green = 0;
// Blue
int blue = 0;
// Neopix
int iNeo = 0;
// Value
int zz = 0;

// SparkFun Micro OLED
#define PIN_RESET 9
#define DC_JUMPER 1
// I2C declaration
MicroOLED oled(PIN_RESET, DC_JUMPER);

// SparkFun BME280 - Temperature, Humidity, Altitude and Barometric Pressure
BME280 myBME280;
// Temperature Celsius
float BMEtempC = 0;
// Humidity
float BMEhumid = 0;
// Altitude Meters
float BMEaltitudeM = 0;
// Barometric Pressure
float BMEpressure = 0;

// SparkFun CCS811 - eCO2 & tVOC
// Default I2C Address
#define CCS811_ADDR 0x5B 
CCS811 myCCS811(CCS811_ADDR);
// eCO2
float CCS811CO2 = 0;
// TVOC
float CCS811TVOC = 0;

// Software Version Information
String sver = "23-05";

void loop() {

  // SparkFun BME280 - Temperature, Humidity, Altitude and Barometric Pressure
  isBME280();

  // SparkFun CCS811 - eCO2 & tVOC
  isCCS811();

  // FLORA
  isFLORA();

  // Micro OLED
  isMicroOLED();
 
}

getBME280.ino

// SparkFun BME280 - Temperature, Humidity, Altitude and Barometric Pressure
// isBME280 - Temperature, Humidity, Altitude and Barometric Pressure
void isBME280(){

  // Temperature Celsius
  BMEtempC = myBME280.readTempC();
  // Humidity
  BMEhumid = myBME280.readFloatHumidity();
  // Altitude Meters
  BMEaltitudeM = myBME280.readFloatAltitudeMeters();
  // Barometric Pressure
  BMEpressure = myBME280.readFloatPressure();
  
}

getCCS811.ino

// CCS811 - eCO2 & tVOC
// isCCS811 - eCO2 & tVOC
void isCCS811(){

  // This sends the temperature & humidity data to the CCS811
  myCCS811.setEnvironmentalData(BMEhumid, BMEtempC);

  // Calling this function updates the global tVOC and eCO2 variables
  myCCS811.readAlgorithmResults();

  // eCO2 Concentration
  CCS811CO2 = myCCS811.getCO2();
  
  // tVOC Concentration
  CCS811TVOC = myCCS811.getTVOC();
  
}

getFLORA.ino

// FLORA
// isFLORA
void isFLORA() {

  // FLORA = Temperature Celsius
  // BMEtempC

  // FLORA = Temperature Celsius
  if ( BMEtempC >= 50 ) {

    // 40 <= Temperature Celsius < 50~~~
    zz = 2;
    isNUMPIXELS();

  } else if ( BMEtempC >= 40 ) {

    // 30 <= Temperature Celsius < 40
    zz = 3;
    isNUMPIXELS();
    
  }  else if ( BMEtempC >= 30 ) {

    // 20 <= Temperature Celsius < 30
    zz = 4;
    isNUMPIXELS();
    
  } else if ( BMEtempC >= 20 ) {

    // 10 <= Temperature Celsius < 20
    zz = 0;
    isNUMPIXELS();
    
  } else if ( BMEtempC >= 10 ) {

    // ~~~0 <= Temperature Celsius < 10
    zz = 1;
    isNUMPIXELS();
    
  }
    
}

getMicroOLED.ino

// SparkFun Micro OLED
// Setup Micro OLED
void setupMicroOLED() {

  // Initialize the OLED
  oled.begin();
  // Clear the display's internal memory
  oled.clear(ALL);
  // Display what's in the buffer (splashscreen)
  oled.display();

  // Delay 1000 ms
  delay(1000);

  // Clear the buffer.
  oled.clear(PAGE);
  
}
// Micro OLED
void isMicroOLED() {

  // Text Display BME280
  // Clear the display
  oled.clear(PAGE);
  // Set cursor to top-left
  oled.setCursor(0, 0);
  // Set font to type 0
  oled.setFontType(0);
  // Temperature Celsius
  oled.print("T: ");
  oled.print(BMEtempC);
  oled.setCursor(0, 10);
  // Humidity
  oled.print("H: ");
  oled.print(BMEhumid);
  oled.setCursor(0, 20);
  // Altitude Meters
  oled.print("A: ");
  oled.print(BMEaltitudeM);
  oled.setCursor(0, 30);
  // Barometric Pressure
  oled.print("P: ");
  oled.print(BMEpressure);
  oled.display();

  // Delay
  delay( 2000 );

  // Text Display CCS811
  // Clear the display
  oled.clear(PAGE);
  // Set cursor to top-left
  oled.setCursor(0, 0);
  // Set font to type 0
  oled.setFontType(0);
  // eCO2 Concentration
  oled.print("eCO2");
  oled.setCursor(0, 10);
  oled.print(CCS811CO2);
  // tVOC Concentration
  oled.setCursor(0, 20);
  oled.print("tVOC");
  oled.setCursor(0, 30);
  oled.print(CCS811TVOC);
  oled.display();

  // Delay
  delay( 2000 );

}

getNeopix.ino

// NeoPixels
// Neopix
void isNeopix() 
{ 

    // Pixels
    pixels.setBrightness( 150 );
    // Pixels color takes RGB values, from 0,0,0 up to 255,255,255
    pixels.setPixelColor( iNeo, pixels.Color(red,green,blue) ); 
    // This sends the updated pixel color to the hardware
    pixels.show(); 
    // Delay for a period of time (in milliseconds)
    delay(50);     
  
}
// isNUMPIXELS
void isNUMPIXELS()
{

  // Neopix Value
  switch ( zz ) {  
    case 0:
      // NeoPixels Green
      // Red
      red = 0;
      // Green
      green = 255;
      // Blue
      blue = 0;
      // Neopix
      iNeo = 0;   
      isNeopix();
      break;  
    case 1:
      // NeoPixels Blue
      // Red
      red = 0;
      // Green
      green = 0;
      // Blue
      blue = 255;
      // Neopix
      iNeo = 0;
      isNeopix();
      break;
    case 2:
      // NeoPixels Red
      // Red
      red = 255;
      // Green
      green = 0;
      // Blue
      blue = 0;
      // Neopix
      iNeo = 0;   
      isNeopix();
      break;
    case 3:
      // NeoPixels Yellow
      // Red
      red = 255;
      // Green
      green = 255;
      // Blue
      blue = 0;
      // Neopix
      iNeo = 0;
      isNeopix();
      break;
    case 4:
      // NeoPixels Magenta
      // Red
      red = 255;
      // Green
      green = 0;
      // Blue
      blue = 255;
      // Neopix
      iNeo = 0;
      isNeopix();
      break;
    case 5:
      // NeoPixels Cyan
      // Red
      red = 0;
      // Green
      green = 255;
      // Blue
      blue = 255;
      // Neopix
      iNeo = 0;
      isNeopix();
      break;
    case 6:
      // NeoPixels White
      // Red
      red = 255;
      // Green
      green = 255;
      // Blue
      blue = 255;
      // Neopix
      iNeo = 0;
      isNeopix();    
      break;
  }
  
}
// isNUMPIXELSoff
void isNUMPIXELSoff()
{

   // Black Off
   // NeoPixels
   // Red
   red = 0;
   // Green
   green = 0;
   // Blue
   blue = 0;
   isNeopix();
 
}

setup.ino

// Setup
void setup() {

  // NeoPixels
  // This initializes the NeoPixel library
  pixels.begin();
  // Delay for a period of time (in milliseconds)
  delay(50);
  // isNUMPIXELS Off
  isNUMPIXELSoff();

  // Set up I2C bus
  Wire.begin();

  // Delay for a period of time (in milliseconds)
  delay(50);
  // SparkFun BME280 - Temperature, Humidity, Altitude and Barometric Pressure
  myBME280.begin();

  // CCS811 - eCO2 & tVOC
  myCCS811.begin();

  // Setup Micro OLED
  setupMicroOLED();

}

——

People can contact us: https://www.donluc.com/?page_id=1927

Technology Experience

  • Single-Board Microcontrollers (PIC, Arduino, Raspberry Pi,Espressif, etc…)
  • IoT
  • Robotics
  • Camera and Video Capture Receiver Stationary, Wheel/Tank and Underwater Vehicle
  • Unmanned Vehicles Terrestrial and Marine
  • Research & Development (R & D)
  • Desktop Applications (Windows, OSX, Linux, Multi-OS, Multi-Tier, etc…)
  • Mobile Applications (Android, iOS, Blackberry, Windows Mobile, Windows CE, etc…)
  • Web Applications (LAMP, Scripting, Java, ASP, ASP.NET, RoR, Wakanda, etc…)
  • Social Media Programming & Integration (Facebook, Twitter, YouTube, Pinterest, etc…)
  • Content Management Systems (WordPress, Drupal, Joomla, Moodle, etc…)
  • Bulletin Boards (phpBB, SMF, Vanilla, jobberBase, etc…)
  • eCommerce (WooCommerce, OSCommerce, ZenCart, PayPal Shopping Cart, etc…)

Instructor and E-Mentor

  • IoT
  • PIC Microcontrollers
  • Arduino
  • Raspberry Pi
  • Espressif
  • Robotics
  • DOS, Windows, OSX, Linux, iOS, Android, Multi-OS
  • Linux-Apache-PHP-MySQL

Follow Us

J. Luc Paquin – Curriculum Vitae – 2022 English & Español
https://www.jlpconsultants.com/luc/

Web: https://www.donluc.com/
Web: https://www.jlpconsultants.com/
Facebook: https://www.facebook.com/neosteam.labs.9/
YouTube: https://www.youtube.com/channel/UC5eRjrGn1CqkkGfZy0jxEdA
Twitter: https://twitter.com/labs_steam
Pinterest: https://www.pinterest.com/NeoSteamLabs/
Instagram: https://www.instagram.com/neosteamlabs/

Don Luc

Project #23: E-Textiles – Bosch Sensortec BME280 – Mk04

——

#DonLucElectronics #DonLuc #ETextiles #Wearable #FLORA #MicroOLED #BME280 #Arduino #Project #Programming #Electronics #Microcontrollers #Consultant

——

Bosch Sensortec BME280

——

Bosch Sensortec BME280

——

Bosch Sensortec BME280

——

Bosch Sensortec BME280 – Combined Humidity And Pressure Sensor

The BME280 is as combined digital humidity, pressure and temperature sensor based on proven sensing principles. Its small dimensions and its low power consumption allow the implementation in battery driven devices such as handsets, GPS modules or watches. The BME280 is register and performance compatible to the Bosch Sensortec BMP280 digital pressure sensor. The BME280 achieves high performance in all applications requiring humidity and pressure measurement. These emerging applications of home automation control, in-door navigation, E-Textiles, fitness as well as GPS refinement require a high accuracy and a low TCO at the same time. The humidity sensor provides an extremely fast response time for fast context awareness applications and high overall accuracy over a wide temperature range. The integrated temperature sensor has been optimized for lowest noise and highest resolution. Its output is used for temperature compensation of the pressure and humidity sensors and can also be used for estimation of the ambient temperature. The sensor provides both SPI and I²C interfaces.

Typical Application

  • Context awareness, e.g. skin detection, room change detection
  • Fitness monitoring / well-being
  • Warning regarding dryness or high temperatures
  • Measurement of volume and air flow
  • Home automation control
  • Control heating, venting, air conditioning (HVAC)
  • Internet of Things
  • GPS enhancement (e.g. time-to-first-fix improvement, dead reckoning, slope detection)
  • Indoor navigation (e.g. change of floor detection, elevator detection)
  • Outdoor navigation, leisure and sports applications
  • Weather forecast
  • Vertical velocity indication (rise/sink speed)
  • E-Textiles and Wearable

Target Devices

  • Handsets such as mobile phones, tablet PCs, GPS devices
  • Navigation systems
  • Gaming (e.g flying toys)
  • Camera (DSC, video)
  • Home weather stations
  • Flying toys
  • Watches
  • E-Textiles
  • Wearable

DL2204Mk04

1 x FLORA – Version 1.0a
1 x SparkFun Micro OLED
1 x SparkFun Environmental Combo CCS811/BME280
1 x RGB Smart NeoPixel
1 x Half-Size Breadboard
1 x SparkFun Cerberus USB Cable

FLORA – Version 1.0a

NEO – Digital 6
SDA – Analog A2
SCL – Analog A3
VIN – +5V
GND – GND

DL2204Mk04p.ino

/* ***** Don Luc Electronics © *****
Software Version Information
Project #23: E-Textiles - BME280 - Mk04
23-04
DL2204Mk04p.ino
1 x FLORA - Version 1.0a
1 x SparkFun Micro OLED
1 x SparkFun Environmental Combo CCS811/BME280
1 x RGB Smart NeoPixel
1 x Half-Size Breadboard
1 x SparkFun Cerberus USB Cable
*/

// Include the Library Code
// Wire
#include <Wire.h>
// NeoPixels
#include <Adafruit_NeoPixel.h>
// SparkFun Micro OLED
#include <SFE_MicroOLED.h>
// SparkFun BME280 - Humidity, Temperature, Altitude and Barometric Pressure
#include <SparkFunBME280.h>

// NeoPixels
// On digital pin 6
#define PIN 6
// NeoPixels NUMPIXELS = 1
#define NUMPIXELS 1
// Pixels
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
// Red
int red = 0;
// Green
int green = 0;
// Blue
int blue = 0;
// Neopix
int iNeo = 0;
// Value
int zz = 0;

// SparkFun Micro OLED
#define PIN_RESET 9
#define DC_JUMPER 1
// I2C declaration
MicroOLED oled(PIN_RESET, DC_JUMPER);

// SparkFun BME280 - Temperature, Humidity, Altitude and Barometric Pressure
BME280 myBME280;
// Temperature Celsius
float BMEtempC = 0;
// Humidity
float BMEhumid = 0;
// Altitude Meters
float BMEaltitudeM = 0;
// Barometric Pressure
float BMEpressure = 0;

// Software Version Information
String sver = "23-04";

void loop() {

  // SparkFun BME280 - Temperature, Humidity, Altitude and Barometric Pressure
  isBME280();

  // FLORA
  isFLORA();

  // Micro OLED
  isMicroOLED();

  // Delay
  delay( 1000 );
  
}

getBME280.ino

// SparkFun BME280 - Temperature, Humidity, Altitude and Barometric Pressure
// isBME280 - Temperature, Humidity, Altitude and Barometric Pressure
void isBME280(){

  // Temperature Celsius
  BMEtempC = myBME280.readTempC();
  // Humidity
  BMEhumid = myBME280.readFloatHumidity();
  // Altitude Meters
  BMEaltitudeM = myBME280.readFloatAltitudeMeters();
  // Barometric Pressure
  BMEpressure = myBME280.readFloatPressure();
  
}

getFLORA.ino

// FLORA
// isFLORA
void isFLORA() {

  // FLORA = Temperature Celsius
  // BMEtempC

  // FLORA = Temperature Celsius
  if ( BMEtempC >= 50 ) {

    // 40 <= Temperature Celsius < 50~~~
    zz = 2;
    isNUMPIXELS();

  } else if ( BMEtempC >= 40 ) {

    // 30 <= Temperature Celsius < 40
    zz = 3;
    isNUMPIXELS();
    
  }  else if ( BMEtempC >= 30 ) {

    // 20 <= Temperature Celsius < 30
    zz = 4;
    isNUMPIXELS();
    
  } else if ( BMEtempC >= 20 ) {

    // 10 <= Temperature Celsius < 20
    zz = 0;
    isNUMPIXELS();
    
  } else if ( BMEtempC >= 10 ) {

    // ~~~0 <= Temperature Celsius < 10
    zz = 1;
    isNUMPIXELS();
    
  }
    
}

getMicroOLED.ino

// SparkFun Micro OLED
// Setup Micro OLED
void setupMicroOLED() {

  // Initialize the OLED
  oled.begin();
  // Clear the display's internal memory
  oled.clear(ALL);
  // Display what's in the buffer (splashscreen)
  oled.display();

  // Delay 1000 ms
  delay(1000);

  // Clear the buffer.
  oled.clear(PAGE);
  
}
// Micro OLED
void isMicroOLED() {

  // Text Display BME280
  // Clear the display
  oled.clear(PAGE);
  // Set cursor to top-left
  oled.setCursor(0, 0);
  // Set font to type 0
  oled.setFontType(0);
  // Temperature Celsius
  oled.print("T: ");
  oled.print(BMEtempC);
  oled.setCursor(0, 10);
  // Humidity
  oled.print("H: ");
  oled.print(BMEhumid);
  oled.setCursor(0, 20);
  // Altitude Meters
  oled.print("A: ");
  oled.print(BMEaltitudeM);
  oled.setCursor(0, 30);
  // Barometric Pressure
  oled.print("P: ");
  oled.print(BMEpressure);
  oled.display();

}

getNeopix.ino

// NeoPixels
// Neopix
void isNeopix() 
{ 

    // Pixels
    pixels.setBrightness( 150 );
    // Pixels color takes RGB values, from 0,0,0 up to 255,255,255
    pixels.setPixelColor( iNeo, pixels.Color(red,green,blue) ); 
    // This sends the updated pixel color to the hardware
    pixels.show(); 
    // Delay for a period of time (in milliseconds)
    delay(50);     
  
}
// isNUMPIXELS
void isNUMPIXELS()
{

  // Neopix Value
  switch ( zz ) {  
    case 0:
      // NeoPixels Green
      // Red
      red = 0;
      // Green
      green = 255;
      // Blue
      blue = 0;
      // Neopix
      iNeo = 0;   
      isNeopix();
      break;  
    case 1:
      // NeoPixels Blue
      // Red
      red = 0;
      // Green
      green = 0;
      // Blue
      blue = 255;
      // Neopix
      iNeo = 0;
      isNeopix();
      break;
    case 2:
      // NeoPixels Red
      // Red
      red = 255;
      // Green
      green = 0;
      // Blue
      blue = 0;
      // Neopix
      iNeo = 0;   
      isNeopix();
      break;
    case 3:
      // NeoPixels Yellow
      // Red
      red = 255;
      // Green
      green = 255;
      // Blue
      blue = 0;
      // Neopix
      iNeo = 0;
      isNeopix();
      break;
    case 4:
      // NeoPixels Magenta
      // Red
      red = 255;
      // Green
      green = 0;
      // Blue
      blue = 255;
      // Neopix
      iNeo = 0;
      isNeopix();
      break;
    case 5:
      // NeoPixels Cyan
      // Red
      red = 0;
      // Green
      green = 255;
      // Blue
      blue = 255;
      // Neopix
      iNeo = 0;
      isNeopix();
      break;
    case 6:
      // NeoPixels White
      // Red
      red = 255;
      // Green
      green = 255;
      // Blue
      blue = 255;
      // Neopix
      iNeo = 0;
      isNeopix();    
      break;
  }
  
}
// isNUMPIXELSoff
void isNUMPIXELSoff()
{

   // Black Off
   // NeoPixels
   // Red
   red = 0;
   // Green
   green = 0;
   // Blue
   blue = 0;
   isNeopix();
 
}

setup.ino

// Setup
void setup() {

  // NeoPixels
  // This initializes the NeoPixel library
  pixels.begin();
  // Delay for a period of time (in milliseconds)
  delay(50);
  // isNUMPIXELS Off
  isNUMPIXELSoff();

  // Set up I2C bus
  Wire.begin();

  // Delay for a period of time (in milliseconds)
  delay(50);
  
  // SparkFun BME280 - Temperature, Humidity, Altitude and Barometric Pressure
  myBME280.begin();

  // Setup Micro OLED
  setupMicroOLED();

}

——

People can contact us: https://www.donluc.com/?page_id=1927

Technology Experience

  • Single-Board Microcontrollers (PIC, Arduino, Raspberry Pi,Espressif, etc…)
  • IoT
  • Robotics
  • Camera and Video Capture Receiver Stationary, Wheel/Tank and Underwater Vehicle
  • Unmanned Vehicles Terrestrial and Marine
  • Research & Development (R & D)
  • Desktop Applications (Windows, OSX, Linux, Multi-OS, Multi-Tier, etc…)
  • Mobile Applications (Android, iOS, Blackberry, Windows Mobile, Windows CE, etc…)
  • Web Applications (LAMP, Scripting, Java, ASP, ASP.NET, RoR, Wakanda, etc…)
  • Social Media Programming & Integration (Facebook, Twitter, YouTube, Pinterest, etc…)
  • Content Management Systems (WordPress, Drupal, Joomla, Moodle, etc…)
  • Bulletin Boards (phpBB, SMF, Vanilla, jobberBase, etc…)
  • eCommerce (WooCommerce, OSCommerce, ZenCart, PayPal Shopping Cart, etc…)

Instructor and E-Mentor

  • IoT
  • PIC Microcontrollers
  • Arduino
  • Raspberry Pi
  • Espressif
  • Robotics
  • DOS, Windows, OSX, Linux, iOS, Android, Multi-OS
  • Linux-Apache-PHP-MySQL

Follow Us

J. Luc Paquin – Curriculum Vitae – 2022 English & Español
https://www.jlpconsultants.com/luc/

Web: https://www.donluc.com/
Web: https://www.jlpconsultants.com/
Facebook: https://www.facebook.com/neosteam.labs.9/
YouTube: https://www.youtube.com/channel/UC5eRjrGn1CqkkGfZy0jxEdA
Twitter: https://twitter.com/labs_steam
Pinterest: https://www.pinterest.com/NeoSteamLabs/
Instagram: https://www.instagram.com/neosteamlabs/

Don Luc

Project #23: E-Textiles – SparkFun Micro OLED – Mk03

——

#DonLucElectronics #DonLuc #ETextiles #Wearable #FLORA #MicroOLED #Arduino #Project #Programming #Electronics #Microcontrollers #Consultant

——

SparkFun Micro OLED

——

SparkFun Micro OLED

——

SparkFun Micro OLED

——

SparkFun Micro OLED Breakout (Qwiic)

The SparkFun Qwiic Micro OLED Breakout is a Qwiic-enabled version of our popular Micro OLED display. The small monochrome, blue-on-black OLED screen presents incredibly clear images for your viewing pleasure. It’s micro, but it still packs a punch the OLED display is crisp, and you can fit a deceivingly large amount of graphics on there. This breakout is perfect for adding graphics to your next project and displaying diagnostic information without resorting to a serial output, all with the ease of use of our own Qwiic Connect System.

This version of the Micro OLED Breakout is exactly the size of its non-Qwiic sibling, featuring a screen that is 64 pixels wide and 48 pixels tall and measuring 0.66 inch across. But it has also been equipped with two Qwiic connectors, making it ideal for I2C operations. We’ve also added two mounting holes and a convenient Qwiic cable holder incorporated into a detachable tab on the board that can be easily removed thanks to a v-scored edge. We’ve even made sure to include an I2C pull-up jumper and ADDR jumper on the back of the board, so if you have your own I2C pull-ups or need to change the I2C address of the board, you have options.

DL2204Mk03

1 x FLORA – Version 1.0a
1 x SparkFun Micro OLED
1 x RGB Smart NeoPixel
1 x Half-Size Breadboard
1 x SparkFun Cerberus USB Cable

FLORA – Version 1.0a

NEO – Digital 6
SDA – Analog A2
SCL – Analog A3
VIN – +5V
GND – GND

——

DL2204Mk03p.ino

/* ***** Don Luc Electronics © *****
Software Version Information
Project #23: E-Textiles - SparkFun Micro OLED - Mk03
23-03
DL2204Mk03p.ino
1 x FLORA - Version 1.0a
1 x SparkFun Micro OLED
1 x RGB Smart NeoPixel
1 x Half-Size Breadboard
1 x SparkFun Cerberus USB Cable
*/

// Include the Library Code
// Wire
#include <Wire.h>
// NeoPixels
#include <Adafruit_NeoPixel.h>
// SparkFun Micro OLED
#include <SFE_MicroOLED.h>

// FLORA
// Color
String sVal;

// NeoPixels
// On digital pin 6
#define PIN 6
// NeoPixels NUMPIXELS = 1
#define NUMPIXELS 1
// Pixels
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
// Red
int red = 0;
// Green
int green = 0;
// Blue
int blue = 0;
// Neopix
int iNeo = 0;
// Value
int zz = 0;

// SparkFun Micro OLED
#define PIN_RESET 9
#define DC_JUMPER 1
// I2C declaration
MicroOLED oled(PIN_RESET, DC_JUMPER);

// Software Version Information
String sver = "23-03";

void loop() {

  // FLORA
  isFLORA();

  // Micro OLED
  isMicroOLED();

  // Delay
  delay( 3000 );
  
}

getFLORA.ino

// FLORA
// isFLORA
void isFLORA() {

  // FLORA = zz => Neopix
  // FLORA = sVal => Color
  if ( zz == 0 ) {

    sVal = "Green";
    isNUMPIXELS();
    zz = 1;
    
  } else if ( zz == 1 ) {

    sVal = "Blue";
    isNUMPIXELS();
    zz = 2;
    
  } else if ( zz == 2 ) {

    sVal = "Red";
    isNUMPIXELS();
    zz = 3;
    
  } else if ( zz == 3 ) {

    sVal = "Yellow";
    isNUMPIXELS();
    zz = 4;
    
  } else if ( zz == 4 ) {

    sVal = "Magenta";
    isNUMPIXELS();
    zz = 5;
    
  } else if ( zz == 5 ) {

    sVal = "Cyan";
    isNUMPIXELS();
    zz = 6;
    
  } else if ( zz == 6 ) {

    sVal = "White";
    isNUMPIXELS();
    zz = 0;
    
  }
    
}

getMicroOLED.ino

// SparkFun Micro OLED
// Setup Micro OLED
void setupMicroOLED() {

  // Initialize the OLED
  oled.begin();
  // Clear the display's internal memory
  oled.clear(ALL);
  // Display what's in the buffer (splashscreen)
  oled.display();

  // Delay 1000 ms
  delay(1000);

  // Clear the buffer.
  oled.clear(PAGE);
  
}
// Micro OLED
void isMicroOLED() {

  // Clear the display
  oled.clear(PAGE);
  // Set cursor to top-left
  oled.setCursor(0, 0);
  // Set font to type 1
  oled.setFontType(1);
  // Print sVal
  oled.print(sVal);
  oled.display();

}

getNeopix.ino

// NeoPixels
// Neopix
void isNeopix() 
{ 

    // Pixels
    pixels.setBrightness( 255 );
    // Pixels color takes RGB values, from 0,0,0 up to 255,255,255
    pixels.setPixelColor( iNeo, pixels.Color(red,green,blue) ); 
    // This sends the updated pixel color to the hardware
    pixels.show(); 
    // Delay for a period of time (in milliseconds)
    delay(50);     
  
}
// isNUMPIXELS
void isNUMPIXELS()
{

  // Neopix Value
  switch ( zz ) {  
    case 0:
      // NeoPixels Green
      // Red
      red = 0;
      // Green
      green = 255;
      // Blue
      blue = 0;
      // Neopix
      iNeo = 0;   
      isNeopix();
      break;  
    case 1:
      // NeoPixels Blue
      // Red
      red = 0;
      // Green
      green = 0;
      // Blue
      blue = 255;
      // Neopix
      iNeo = 0;
      isNeopix();
      break;
    case 2:
      // NeoPixels Red
      // Red
      red = 255;
      // Green
      green = 0;
      // Blue
      blue = 0;
      // Neopix
      iNeo = 0;   
      isNeopix();
      break;
    case 3:
      // NeoPixels Yellow
      // Red
      red = 255;
      // Green
      green = 255;
      // Blue
      blue = 0;
      // Neopix
      iNeo = 0;
      isNeopix();
      break;
    case 4:
      // NeoPixels Magenta
      // Red
      red = 255;
      // Green
      green = 0;
      // Blue
      blue = 255;
      // Neopix
      iNeo = 0;
      isNeopix();
      break;
    case 5:
      // NeoPixels Cyan
      // Red
      red = 0;
      // Green
      green = 255;
      // Blue
      blue = 255;
      // Neopix
      iNeo = 0;
      isNeopix();
      break;
    case 6:
      // NeoPixels White
      // Red
      red = 255;
      // Green
      green = 255;
      // Blue
      blue = 255;
      // Neopix
      iNeo = 0;
      isNeopix();    
      break;
  }
  
}
// isNUMPIXELSoff
void isNUMPIXELSoff()
{

   // Black Off
   // NeoPixels
   // Red
   red = 0;
   // Green
   green = 0;
   // Blue
   blue = 0;
   isNeopix();
 
}

setup.ino

// Setup
void setup() {

  // NeoPixels
  // This initializes the NeoPixel library
  pixels.begin();
  // Delay for a period of time (in milliseconds)
  delay(50);
  // isNUMPIXELS Off
  isNUMPIXELSoff();

  // Set up I2C bus
  Wire.begin();

  // Delay for a period of time (in milliseconds)
  delay(50);

  // Setup Micro OLED
  setupMicroOLED();

}

——

People can contact us: https://www.donluc.com/?page_id=1927

Technology Experience

  • Single-Board Microcontrollers (PIC, Arduino, Raspberry Pi,Espressif, etc…)
  • IoT
  • Robotics
  • Camera and Video Capture Receiver Stationary, Wheel/Tank and Underwater Vehicle
  • Unmanned Vehicles Terrestrial and Marine
  • Research & Development (R & D)
  • Desktop Applications (Windows, OSX, Linux, Multi-OS, Multi-Tier, etc…)
  • Mobile Applications (Android, iOS, Blackberry, Windows Mobile, Windows CE, etc…)
  • Web Applications (LAMP, Scripting, Java, ASP, ASP.NET, RoR, Wakanda, etc…)
  • Social Media Programming & Integration (Facebook, Twitter, YouTube, Pinterest, etc…)
  • Content Management Systems (WordPress, Drupal, Joomla, Moodle, etc…)
  • Bulletin Boards (phpBB, SMF, Vanilla, jobberBase, etc…)
  • eCommerce (WooCommerce, OSCommerce, ZenCart, PayPal Shopping Cart, etc…)

Instructor and E-Mentor

  • IoT
  • PIC Microcontrollers
  • Arduino
  • Raspberry Pi
  • Espressif
  • Robotics
  • DOS, Windows, OSX, Linux, iOS, Android, Multi-OS
  • Linux-Apache-PHP-MySQL

Follow Us

J. Luc Paquin – Curriculum Vitae – 2022 English & Español
https://www.jlpconsultants.com/luc/

Web: https://www.donluc.com/
Web: https://www.jlpconsultants.com/
Facebook: https://www.facebook.com/neosteam.labs.9/
YouTube: https://www.youtube.com/channel/UC5eRjrGn1CqkkGfZy0jxEdA
Twitter: https://twitter.com/labs_steam
Pinterest: https://www.pinterest.com/NeoSteamLabs/
Instagram: https://www.instagram.com/neosteamlabs/

Don Luc

Project #23: E-Textiles – FLORA – Mk02

——

#DonLucElectronics #DonLuc #ETextiles #Wearable #FLORA #Arduino #Project #Programming #Electronics #Microcontrollers #Consultant

——

FLORA

——

FLORA

——

FLORA

——

FLORA – Wearable Electronic Platform – Version 1.0a

FLORA is Adafruit’s fully-featured wearable electronics platform. It’s a round, sewable, Arduino-compatible microcontroller designed to empower amazing wearables projects. The FLORA family also has the best stainless steel threads, sensors, GPS modules and chainable LED NeoPixels, perfect accessories for the FLORA main board. It’s built around the Atmega32u4 chip, which has built-in USB support, is wearable Arduino / Arduino-compatible.

The FLORA has built-in USB support. Built in USB means you plug it in to program it, it just shows up, all you need is a Mini-B USB cable, no additional purchases are needed. The FLORA has USB HID support, so it can act like a mouse or keyboard to attach directly to computers.

FLORA has a small but easy to use onboard reset button to reboot the system. The power supply is designed to be flexible and easy to use. Can be used with LiIon/LiPoly, LiFe, alkaline or rechargeable NiMh/NiCad batteries of any size. The FLORA does not have a LiPo charger included by design, this allows safe use with multiple battery types and reduces risk of fire as it is not recommended to charge these batteries on fabric. We suggest one of our micro-lipo chargers if you want to use LiPo batteries with FLORA.

FLORA has onboard power switch connected to 2A power FET for safe and efficient battery on/off control, so you can power quite a bit without burning out your switch. The FLORA has an onboard 3.3v 250mA regulator with a protection diode and USB fuse so that the microcontroller voltage is consistent and can power common 3.3v modules and sensors.

FLORA

  • FLORA is fabric friendly, all the components on board are flush to the PCB and won’t snag delicate garments.
  • FLORA is extremely beginner-friendly. it is difficult to destroy the FLORA by connecting a battery backwards due to polarized connector and protection diodes.
  • The FLORA has 4 indicator LEDs: power good, digital signal LED for bootloader feedback, data rx/tx. Also onboard is an ICSP connector for easy reprograming for advanced users.
  • There are 14 sewing tap pads for attachment and electrical connections. Data buses are interleaved with power and ground pads for easy module and sensor attachments without worrying about overlapping traces which are not possible with conductive thread.

DL2204Mk01

1 x FLORA – Version 1.0a
1 x RGB Smart NeoPixel
1 x Half-Size Breadboard
1 x SparkFun Cerberus USB Cable

FLORA – Version 1.0a

NEO – Digital 6
VIN – +5V
GND – GND

DL2204Mk01p.ino

/* ***** Don Luc Electronics © *****
Software Version Information
Project #23: E-Textiles - FLORA - Wearable Electronic Platform - Mk02
23-02
DL2204Mk02p.ino
1 x FLORA - Version 1.0a
1 x RGB Smart NeoPixel
1 x Half-Size Breadboard
1 x SparkFun Cerberus USB Cable
*/

// Include the Library Code
// NeoPixels
#include <Adafruit_NeoPixel.h>

// NeoPixels
// On digital pin 6
#define PIN 6
// NeoPixels NUMPIXELS = 1
#define NUMPIXELS 1
// Pixels
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
// Red
int red = 0;
// Green
int green = 0;
// Blue
int blue = 0;
// Neopix
int iNeo = 0;
// Value
int zz = 0;

// Software Version Information
String sver = "23-02";

void loop() {

  // FLORA
  isFLORA();
  delay( 2000 );
  
}

getFLORA.ino

// FLORA
// isFLORA
void isFLORA() {

  // FLORA = zz => Neopix
  if ( zz == 0 ) {

    isNUMPIXELS();
    zz = 1;
    
  } else if ( zz == 1 ) {

    isNUMPIXELS();
    zz = 2;
    
  } else if ( zz == 2 ) {

    isNUMPIXELS();
    zz = 3;
    
  } else if ( zz == 3 ) {

    isNUMPIXELS();
    zz = 4;
    
  } else if ( zz == 4 ) {

    isNUMPIXELS();
    zz = 5;
    
  } else if ( zz == 5 ) {

    isNUMPIXELS();
    zz = 6;
    
  } else if ( zz == 6 ) {

    isNUMPIXELS();
    zz = 0;
    
  }
    
}

getNeopix.ino

// NeoPixels
// Neopix
void isNeopix() 
{ 

    // Pixels
    pixels.setBrightness( 255 );
    // Pixels color takes RGB values, from 0,0,0 up to 255,255,255
    pixels.setPixelColor( iNeo, pixels.Color(red,green,blue) ); 
    // This sends the updated pixel color to the hardware
    pixels.show(); 
    // Delay for a period of time (in milliseconds)
    delay(50);     
  
}
// isNUMPIXELS
void isNUMPIXELS()
{

  // Neopix Value
  switch ( zz ) {  
    case 0:
      // NeoPixels Green
      // Red
      red = 0;
      // Green
      green = 255;
      // Blue
      blue = 0;
      // Neopix
      iNeo = 0;   
      isNeopix();
      break;  
    case 1:
      // NeoPixels Blue
      // Red
      red = 0;
      // Green
      green = 0;
      // Blue
      blue = 255;
      // Neopix
      iNeo = 0;
      isNeopix();
      break;
    case 2:
      // NeoPixels Red
      // Red
      red = 255;
      // Green
      green = 0;
      // Blue
      blue = 0;
      // Neopix
      iNeo = 0;   
      isNeopix();
      break;
    case 3:
      // NeoPixels Yellow
      // Red
      red = 255;
      // Green
      green = 255;
      // Blue
      blue = 0;
      // Neopix
      iNeo = 0;
      isNeopix();
      break;
    case 4:
      // NeoPixels Magenta
      // Red
      red = 255;
      // Green
      green = 0;
      // Blue
      blue = 255;
      // Neopix
      iNeo = 0;
      isNeopix();
      break;
    case 5:
      // NeoPixels Cyan
      // Red
      red = 0;
      // Green
      green = 255;
      // Blue
      blue = 255;
      // Neopix
      iNeo = 0;
      isNeopix();
      break;
    case 6:
      // NeoPixels White
      // Red
      red = 255;
      // Green
      green = 255;
      // Blue
      blue = 255;
      // Neopix
      iNeo = 0;
      isNeopix();    
      break;
  }
  
}
// isNUMPIXELSoff
void isNUMPIXELSoff()
{

   // Black Off
   // NeoPixels
   // Red
   red = 0;
   // Green
   green = 0;
   // Blue
   blue = 0;
   isNeopix();
 
}

setup.ino

// Setup
void setup() {

  // NeoPixels
  // This initializes the NeoPixel library
  pixels.begin();
  // Delay for a period of time (in milliseconds)
  delay(50);
  // isNUMPIXELS Off
  isNUMPIXELSoff();

}

——

People can contact us: https://www.donluc.com/?page_id=1927

Technology Experience

  • Single-Board Microcontrollers (PIC, Arduino, Raspberry Pi,Espressif, etc…)
  • IoT
  • Robotics
  • Camera and Video Capture Receiver Stationary, Wheel/Tank and Underwater Vehicle
  • Unmanned Vehicles Terrestrial and Marine
  • Research & Development (R & D)
  • Desktop Applications (Windows, OSX, Linux, Multi-OS, Multi-Tier, etc…)
  • Mobile Applications (Android, iOS, Blackberry, Windows Mobile, Windows CE, etc…)
  • Web Applications (LAMP, Scripting, Java, ASP, ASP.NET, RoR, Wakanda, etc…)
  • Social Media Programming & Integration (Facebook, Twitter, YouTube, Pinterest, etc…)
  • Content Management Systems (WordPress, Drupal, Joomla, Moodle, etc…)
  • Bulletin Boards (phpBB, SMF, Vanilla, jobberBase, etc…)
  • eCommerce (WooCommerce, OSCommerce, ZenCart, PayPal Shopping Cart, etc…)

Instructor and E-Mentor

  • IoT
  • PIC Microcontrollers
  • Arduino
  • Raspberry Pi
  • Espressif
  • Robotics
  • DOS, Windows, OSX, Linux, iOS, Android, Multi-OS
  • Linux-Apache-PHP-MySQL

Follow Us

J. Luc Paquin – Curriculum Vitae – 2022 English & Español
https://www.jlpconsultants.com/luc/

Web: https://www.donluc.com/
Web: https://www.jlpconsultants.com/
Facebook: https://www.facebook.com/neosteam.labs.9/
YouTube: https://www.youtube.com/channel/UC5eRjrGn1CqkkGfZy0jxEdA
Twitter: https://twitter.com/labs_steam
Pinterest: https://www.pinterest.com/NeoSteamLabs/
Instagram: https://www.instagram.com/neosteamlabs/

Don Luc

Project #22: Synthesizer – The AcceleroSynth 2012 – Mk01

——

#DonLucElectronics #DonLuc #Synthesizer #Programming #Electronics #Microcontrollers #Consultant

——

The AcceleroSynth 2012

——

Synthesizer, Music Synthesizer Or Electronic Sound Synthesizer

Synthesizer machine that electronically generates and modifies sounds, frequently with the use of a digital computer. Synthesizers are used for the composition of electronic music and in live performance. Synthesizers are typically played with keyboards or controlled by sequencers, software or other instruments. A electronic musical instrument that generates audio signals. Synthesizers typically create sounds by generating waveforms, through methods including subtractive synthesis, additive synthesis and frequency modulation synthesis. These sounds may be altered by components such as filters, which cut or boost frequencies, envelopes, which control articulation, or how notes begin and end, and low-frequency oscillators, which modulate parameters such as pitch, volume, or filter characteristics affecting timbre.

The AcceleroSynth – 2012

We are finally ready for our first electronics project, The AcceleroSynth. It is an microcontroller-based (Arduino) music synth that is controller by a 3 axis analog accelerometer. It will be both a hardware and a software synth. This is the announcement for the project and in the coming days I will post the BOM (Bill of Material), schematics and Arduino code with the first assembly video. The project will first be assembled on a protoboard, then a soldered version will be built either on a perfboard or on an Arduino ProtoShield. If there is enough demand either a PCB or an Arduino Shield will be built for the project and sold here. More on that later. The first installment on the building of the project should be up on a few days.

People can contact us: https://www.donluc.com/?page_id=1927

Technology Experience

  • Single-Board Microcontrollers (PIC, Arduino, Raspberry Pi,Espressif, etc…)
  • IoT
  • Robotics
  • Camera and Video Capture Receiver Stationary, Wheel/Tank and Underwater Vehicle
  • Unmanned Vehicles Terrestrial and Marine
  • Research & Development (R & D)
  • Desktop Applications (Windows, OSX, Linux, Multi-OS, Multi-Tier, etc…)
  • Mobile Applications (Android, iOS, Blackberry, Windows Mobile, Windows CE, etc…)
  • Web Applications (LAMP, Scripting, Java, ASP, ASP.NET, RoR, Wakanda, etc…)
  • Social Media Programming & Integration (Facebook, Twitter, YouTube, Pinterest, etc…)
  • Content Management Systems (WordPress, Drupal, Joomla, Moodle, etc…)
  • Bulletin Boards (phpBB, SMF, Vanilla, jobberBase, etc…)
  • eCommerce (WooCommerce, OSCommerce, ZenCart, PayPal Shopping Cart, etc…)

Instructor and E-Mentor

  • IoT
  • PIC Microcontrollers
  • Arduino
  • Raspberry Pi
  • Espressif
  • Robotics
  • DOS, Windows, OSX, Linux, iOS, Android, Multi-OS
  • Linux-Apache-PHP-MySQL

Follow Us

J. Luc Paquin – Curriculum Vitae – 2022 English & Español
https://www.jlpconsultants.com/luc/

Web: https://www.donluc.com/
Web: https://www.jlpconsultants.com/
Facebook: https://www.facebook.com/neosteam.labs.9/
YouTube: https://www.youtube.com/channel/UC5eRjrGn1CqkkGfZy0jxEdA
Twitter: https://twitter.com/labs_steam
Pinterest: https://www.pinterest.com/NeoSteamLabs/
Instagram: https://www.instagram.com/neosteamlabs/

Don Luc

Project #12: Robotics – Pololu Wheel – Mk23

——

#DonLucElectronics #DonLuc #Robotics #Arduino #Fio #ArduinoProMini #XBee #DCMotor #MotorDriver #Project #Fritzing #Programming #Electronics #Microcontrollers #Consultant

——

Pololu Wheel

——

Pololu Wheel

——

Pololu Wheel

——

Pololu Wheel 90 mm × 10 mm – Black

These black plastic wheels have silicone tires and measure 90 mm (3.54 inches) in diameter, and they press-fit onto the 3mm D shafts on many of our motors, including our micro metal gearmotors and our mini plastic gearmotors. Additionally, this wheel is compatible with several of our universal mounting hubs, which can serve as adapters for motors with different shafts. Six mounting holes for #4 or M3 screws make it possible to use the wheel with any of our universal mounting hubs for those screw sizes, enabling these wheels to be used with our larger metal gearmotors and stepper motors. The included silicone tires, which feature horizontal treads for improved traction.

DL2202Mk03

1 x Fio v3 – ATmega32U4
1 x Arduino Pro Mini 328 – 5V/16MHz
1 x SparkFun FTDI Basic Breakout – 5V
1 x USB/DC Lithium Polymer Battery Charger
1 x Mountable Slide Switch
2 x XBee S1
1 x XBee Explorer Regulated
1 x Lithium Ion Battery – 850mAh
1 x Lithium Ion Battery – 2500mAh
1 x Thumb Joystick
1 x SparkFun Thumb Joystick Breakout
1 x Slide Pot (Small)
1 x Slide Potentiometer Knob
1 x RGB Smart NeoPixel
2 x DRV8835 Dual Motor Driver Carrier
2 x Solarbotics RM2
2 x Pololu Universal Aluminum Mounting Hub 3mm Shaft, #4-40 Holes
2 x Pololu Mini Plastic Gearmotor Bracket Pair – Wide
1 x Steren Model 155
2 x Adafruit Perma-Proto Quarter-Sized Breadboard
15 x Standoff – Metal – #4-40 – 3/8 inch
33 x Screw – #4-40 – 1/4 inch
3 x Nut – Nylon Locknut – #4-40
1 x Pololu Ball Caster – 1 Inch Plastic Ball
1 x HDPE – Black on White – 6 inches x 12 inches x 0.25 inch
2 x Pololu Wheel 90 mm × 10 mm – Black
4 x Screw – #4-40 – 3/8 inch
1 x SparkFun Cerberus USB Cable

Fio v3 – ATmega32U4 – Transmitter

XBee S1: Transmitter

CH Channel: C
PAN Id: 3333
SH Serial Number: 13A200
SL Serial Number: 40717A1F
CE Coordinator: Coordinator
BD: 9600

RX0 – Digital 0
TX0 – Digital 1
PO0 – Analog A0
JY0 – Analog A1
JY1 – Analog A2
SE0 – Digital 16
VIN – +3.3V
GND – GND

DL2202Mk03t.ino

/* ***** Don Luc Electronics © *****
Software Version Information
Project #12: Robotics - Pololu Wheel - Mk23
02-03
Transmitter
DL2202Mk03t.ino
1 x Fio v3 - ATmega32U4
1 x XBee S1
1 x Lithium Ion Battery - 850mAh
1 x Thumb Joystick
1 x SparkFun Thumb Joystick Breakout
1 x Slide Pot (Small)
1 x Slide Potentiometer Knob
1 x SparkFun Cerberus USB Cable
*/

// Include the Library Code
// EEPROM library to read and write EEPROM with unique ID for unit
#include <EEPROM.h>

// Communication
unsigned long dTime = 200;

// Slide Pot (Small)
// Select the input pin for the slide pot
// Power
const int iSP1 = A0;
// Power to store the value
int iPower = 0;

// Connections to joystick
// Vertical
const int VERT = A1;
// Horizontal
const int HORIZ = A2;
// Pushbutton
const int SEL = 16;
// Initialize variables for analog and digital values
int vertical;
int horizontal;
int select;

// Software Version Information
// Version
String sver = "12-23t";
// Unit ID Information
// UID
String uid = "";

void loop()
{

  // Thumb Joystick
  isThumbJoystick();
    
  // Process Message
  isProcessMessage();

  delay( dTime );
  
}

getEEPROM.ino

// EEPROM
// is UID
void isUID()
{
  
  // Is Unit ID
  // UID
  uid = "";
  for (int x = 0; x < 5; x++)
  {
    uid = uid + char(EEPROM.read(x));
  }
  
}

getProcessMessage.ino

// Process Message
// isProcessMessage
void isProcessMessage() {
  
   // Loop through serial buffer
   // Print = "<" + vertical + "|" + horizontal + "|" + select + "|" + iValue + "|" + sver + "|" + uid + "*"
      
   Serial1.print( '<'  );
   Serial1.print( vertical );
   Serial1.print( '|' );
   Serial1.print( horizontal );
   Serial1.print( '|' );
   Serial1.print( select );
   Serial1.print( '|' );
   Serial1.print( iPower );
   Serial1.print( '|' );
   Serial1.print( sver );
   Serial1.print( '|' );
   Serial1.print( uid );
   Serial1.println( '*' );

}

getThumbJoystick.ino

// Thumb Joystick
void isThumbJoystick() {

  // Read all values from the joystick
  // Joystick was sitting around 520 for the vertical and horizontal values
  // Will be 0-1023
  vertical = analogRead(VERT);
  // Will be 0-1023
  horizontal = analogRead(HORIZ);
  // Will be HIGH (1) if not pressed, and LOW (0) if pressed
  select = digitalRead(SEL);
  // Read the value
  // Power be 0-1023
  iPower = analogRead( iSP1 );
 
}

setup.ino

// Setup
void setup()
{

  // EEPROM Unit ID
  isUID();
  
  // Pause
  delay(5);
  
  // Make the SEL line an input
  pinMode(SEL, INPUT_PULLUP);
  
  // Open Serial1 port at 9600 baud
  Serial1.begin( 9600 );

  // Pause
  delay(5);

}

——

Arduino Pro Mini 328 – 5V/16MHz – Receiver

XBee S1: Receiver

CH Channel: C
PAN Id: 3333
SH Serial Number: 13A200
SL Serial Number: 4076E2C5
CE Coordinator: End Device
BD: 9600

RX0 – Digital 0
TX0 – Digital 1
M11 – Digital 2
M12 – Digital 3
M21 – Digital 4
M22 – Digital 5
NEO – Digital 6
VIN – +5V
GND – GND

DL2202Mk03r.ino

/* ***** Don Luc Electronics © *****
Software Version Information
Project #12: Robotics - Pololu Wheel - Mk23
02-03
Receiver
DL2202Mk03r.ino
1 x Arduino Pro Mini 328 - 5V/16MHz
1 x SparkFun FTDI Basic Breakout - 5V
1 x XBee S1
1 x XBee Explorer Regulated
1 x USB/DC Lithium Polymer Battery Charger
1 x Mountable Slide Switch
1 x Lithium Ion Battery - 2500mAh
1 x RGB Smart NeoPixel
2 x DRV8835 Dual Motor Driver Carrier
2 x Solarbotics RM2
2 x Pololu Universal Aluminum Mounting Hub 3mm Shaft, #4-40 Holes
2 x Pololu Mini Plastic Gearmotor Bracket Pair - Wide
1 x Steren Model 155
2 x Adafruit Perma-Proto Quarter-Sized Breadboard
15 x Standoff - Metal - #4-40 - 3/8 inch
33 x Screw - #4-40 - 1/4 inch
3 x Nut - Nylon Locknut - #4-40
1 x Pololu Ball Caster - 1 Inch Plastic Ball
1 x HDPE - Black on White - 6 inches x 12 inches x 0.25 inch
2 x Pololu Wheel 90 mm × 10 mm - Black
4 x Screw - #4-40 - 3/8 inch
1 x SparkFun Cerberus USB Cable
*/

// Include the library code:
// EEPROM library to read and write EEPROM with unique ID for unit
#include <EEPROM.h>
// NeoPixels
#include <Adafruit_NeoPixel.h>

// Solarbotics RM2 -> 1
#define MOTOR1_IN1 2
#define MOTOR1_IN2 3
// Solarbotics RM2 -> 2
#define MOTOR2_IN1 4
#define MOTOR2_IN2 5

// Power be 0-1023
int iPower = 0;
String POW = "";
// Joystick was sitting around 520 for the vertical and horizontal values
// Will be 0-1023
// Vertical
int vertical;
String VER = "";
// Horizontal
// Will be 0-1023
int horizontal;
String HOR = "";
// Select
// Will be HIGH (1) if not pressed, and LOW (0) if pressed
int select1 = 0;
String SEL = "";
int firstClosingBracket = 0;
// Map Vertical and Horizontal
int mapVer = 0;
int mapHor = 0;
int iVer = 1;
int iHor = 0;

// NeoPixels
// On digital pin 6
#define PIN 6
// NeoPixels NUMPIXELS = 1
#define NUMPIXELS 1
// Pixels
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
// Red
int red = 0;
// Green
int green = 0;
// Blue
int blue = 0;
// Neopix
int iNeo = 0;
// Value
int zz = 0;

// Process Message
// Start
bool bStart = false;
// End
bool bEnd   = false;
// Variable to store the incoming byte
int incb = 0;
// Message
String msg = "";
// Index
byte in = 0;
int x = 0;

// Software Version Information
String sver = "12-23r";
// Unit ID information
String uid = "";

void loop() {

  // Check for serial messages
  isProcessMessage();

}

getEEPROM.ino

// EEPROM
// isUID
void isUID()
{
  
  // Is Unit ID
  uid = "";
  for (int x = 0; x < 5; x++)
  {
    uid = uid + char(EEPROM.read(x));
  }
  
}

getNeopix.ino

// NeoPixels
// Neopix
void isNeopix() 
{ 

    // Pixels
    pixels.setBrightness( 130 );
    // Pixels color takes RGB values, from 0,0,0 up to 255,255,255
    pixels.setPixelColor( iNeo, pixels.Color(red,green,blue) ); 
    // This sends the updated pixel color to the hardware
    pixels.show(); 
    // Delay for a period of time (in milliseconds)
    delay(50);     
  
}
// isNUMPIXELS
void isNUMPIXELS()
{

  // Neopix Value
  switch ( zz ) {  
    case 0:
      // NeoPixels Green
      // Red
      red = 0;
      // Green
      green = 255;
      // Blue
      blue = 0;
      // Neopix
      iNeo = 0;   
      isNeopix();
      break;  
    case 1:
      // NeoPixels Blue
      // Red
      red = 0;
      // Green
      green = 0;
      // Blue
      blue = 255;
      // Neopix
      iNeo = 0;
      isNeopix();
      break;
    case 2:
      // NeoPixels Red
      // Red
      red = 255;
      // Green
      green = 0;
      // Blue
      blue = 0;
      // Neopix
      iNeo = 0;   
      isNeopix();
      break;
    case 3:
      // NeoPixels Yellow
      // Red
      red = 255;
      // Green
      green = 255;
      // Blue
      blue = 0;
      // Neopix
      iNeo = 0;
      isNeopix();
      break;
    case 4:
      // NeoPixels Magenta
      // Red
      red = 255;
      // Green
      green = 0;
      // Blue
      blue = 255;
      // Neopix
      iNeo = 0;
      isNeopix();
      break;
    case 5:
      // NeoPixels Cyan
      // Red
      red = 0;
      // Green
      green = 255;
      // Blue
      blue = 255;
      // Neopix
      iNeo = 0;
      isNeopix();
      break;
    case 6:
      // NeoPixels White
      // Red
      red = 255;
      // Green
      green = 255;
      // Blue
      blue = 255;
      // Neopix
      iNeo = 0;
      isNeopix();    
      break;
  }
  
}
// isNUMPIXELSoff
void isNUMPIXELSoff()
{

   // Black Off
   // NeoPixels
   // Red
   red = 0;
   // Green
   green = 0;
   // Blue
   blue = 0;
   isNeopix();
 
}

getProcessMessage.ino

// ProcessMessage
// isProcessMessage
void isProcessMessage() {

  // Loop through serial buffer one byte at a time until you reach * which will be end of message
  while ( Serial.available() > 0 ) 
  {
      
      // Read the incoming byte:
      incb = Serial.read();
      
      // Start the message when the '<' symbol is received
      if(incb == '<')
      {

        // Start
        bStart = true;
        in = 0;
        msg = "";
        
      }
      // End the message when the '*' symbol is received
      else if(incb == '*')
      {
        
        // End
        bEnd = true;
        x = msg.length();
        msg.remove( x , 1);
        // Done reading
        
        break;
      }
      // Read the message
      else
      {
        
        // Message
        msg = msg + char(incb);
        in++;

      }
      
   }

   // Start - End
   if( bStart && bEnd)
   {

      // isRM2Motor => Message
      isRM2Motor();
      
      // Start - End
      in = 0;
      msg = "";
      bStart = false;
      bEnd = false;
      vertical;
      horizontal;
      iPower;
      
   }

}

getRM2Motor.ino

// RM2 Motor
// Setup RM2 Motor
void isSetupRM2Motor() {

  // Solarbotics RM2 -> 1
  pinMode(MOTOR1_IN1, OUTPUT);
  pinMode(MOTOR1_IN2, OUTPUT);
  // Solarbotics RM2 -> 2
  pinMode(MOTOR2_IN1, OUTPUT);
  pinMode(MOTOR2_IN2, OUTPUT);
  
}
// isRM2Motor
void isRM2Motor() {

  // msg = vertical + "|" + horizontal + "|" + select + "|" + iValue + "|" + sver + "|" + uid
  firstClosingBracket = 0;
  // Vertical
  firstClosingBracket = msg.indexOf('|');
  VER = msg;
  VER.remove(firstClosingBracket);
  vertical = VER.toInt();
  // Horizontal
  firstClosingBracket = firstClosingBracket + 1;
  msg.remove(0, firstClosingBracket );
  firstClosingBracket = msg.indexOf('|');
  HOR = msg;
  HOR.remove(firstClosingBracket);
  horizontal = HOR.toInt();
  // Select
  firstClosingBracket = firstClosingBracket + 1;
  msg.remove(0, firstClosingBracket );  
  firstClosingBracket = msg.indexOf('|');
  SEL = msg;
  SEL.remove(firstClosingBracket);
  select1 = SEL.toInt();
  // Power
  firstClosingBracket = firstClosingBracket + 1;
  msg.remove(0, firstClosingBracket );    
  firstClosingBracket = msg.indexOf('|');
  POW = msg;
  POW.remove(firstClosingBracket);
  iPower = POW.toInt();

  // Set the direction
  // Joystick was sitting around 520 for the vertical and horizontal values
  // Will be 0-1023
  mapVer = map(vertical, 0, 1023, -512, 512);
  mapHor = map(horizontal, 0, 1023, -512, 512);
  // Power
  iPower = map(iPower, 0, 1023, 80, 200);

  // Vertical and Horizontal 
  if ( mapVer == -512 ) {

      // Backward
      // NeoPixels Blue
      zz = 1;
      isNUMPIXELS();
      iVer = 1;
    
  } else if ( mapVer == 512 ) {

      // Forward
      // NeoPixels Green
      zz = 0;
      isNUMPIXELS();
      iVer = 2;
 
  } else if ( mapHor == -512 ) {

      // Left
      // NeoPixels Yellow
      zz = 3;
      isNUMPIXELS();
      iVer = 3;
    
  } else if ( mapHor == 512 ) {

      // Right
      // NeoPixels Magenta
      zz = 4;
      isNUMPIXELS();
      iVer = 4;
 
  } else {

    // Stop
    // NeoPixels Red
    zz = 2;
    isNUMPIXELS();
    iVer = 5;
    
  }

  // XBee Car
  switch ( iVer ) {
    case 1:

      // Solarbotics RM2 -> 1 Forward
      digitalWrite(MOTOR1_IN1, LOW);
      analogWrite(MOTOR1_IN2, iPower);
      delay(10);

      // Solarbotics RM2 -> 2 Forward
      digitalWrite(MOTOR2_IN2, LOW);
      analogWrite(MOTOR2_IN1, iPower);
      delay(10);

      break;
    case 2:

      // Solarbotics RM2 -> 1 Backward
      digitalWrite(MOTOR1_IN2, LOW);
      analogWrite(MOTOR1_IN1, iPower);
      delay(10);
      
      // Solarbotics RM2 -> 2 Backward
      digitalWrite(MOTOR2_IN1, LOW);
      analogWrite(MOTOR2_IN2, iPower);
      delay(10);

      break;
    case 3:

      // Right
      // Solarbotics RM2 -> 1 Forward
      digitalWrite(MOTOR1_IN1, LOW);
      analogWrite(MOTOR1_IN2, iPower);
      delay(10);

      // Solarbotics RM2 -> 2 Forward
      digitalWrite(MOTOR2_IN1, LOW);
      analogWrite(MOTOR2_IN2, iPower);
      delay(10);

      break;
    case 4:

      // Left
      // Solarbotics RM2 -> 1 Backward
      digitalWrite(MOTOR1_IN2, LOW);
      analogWrite(MOTOR1_IN1, iPower);
      delay(10);

      // Solarbotics RM2 -> 2 Backward
      digitalWrite(MOTOR2_IN2, LOW);
      analogWrite(MOTOR2_IN1, iPower);
      delay(10);
      
      break;
    case 5:

      // Stop
      // NeoPixels Red
      //zz = 2;
      //isNUMPIXELS();
      // Solarbotics RM2 -> 1
      digitalWrite(MOTOR1_IN1, LOW);
      analogWrite(MOTOR1_IN2, 0);
      delay(10);

      // Solarbotics RM2 -> 2 
      digitalWrite(MOTOR2_IN1, LOW);
      analogWrite(MOTOR2_IN2, 0);
      delay(10); 
      
      break;
 }

}

setup.ino

// Setup
void setup() {

  // Open the serial port at 9600 bps:
  Serial.begin( 9600 );

  // Pause
  delay(5);

  // EEPROM Unit ID
  isUID();
  
  // Pause
  delay(5);

  // Setup Solarbotics RM2 Motor
  isSetupRM2Motor();

  // Pause
  delay(5);
  
  // NeoPixels
  // This initializes the NeoPixel library
  pixels.begin();
  // Delay for a period of time (in milliseconds)
  delay(50);
  // isNUMPIXELS Off
  isNUMPIXELSoff();

}

——

People can contact us: https://www.donluc.com/?page_id=1927

Technology Experience

  • Single-Board Microcontrollers (PIC, Arduino, Raspberry Pi,Espressif, etc…)
  • IoT
  • Robotics
  • Camera and Video Capture Receiver Stationary, Wheel/Tank and Underwater Vehicle
  • Unmanned Vehicles Terrestrial and Marine
  • Research & Development (R & D)
  • Desktop Applications (Windows, OSX, Linux, Multi-OS, Multi-Tier, etc…)
  • Mobile Applications (Android, iOS, Blackberry, Windows Mobile, Windows CE, etc…)
  • Web Applications (LAMP, Scripting, Java, ASP, ASP.NET, RoR, Wakanda, etc…)
  • Social Media Programming & Integration (Facebook, Twitter, YouTube, Pinterest, etc…)
  • Content Management Systems (WordPress, Drupal, Joomla, Moodle, etc…)
  • Bulletin Boards (phpBB, SMF, Vanilla, jobberBase, etc…)
  • eCommerce (WooCommerce, OSCommerce, ZenCart, PayPal Shopping Cart, etc…)

Instructor and E-Mentor

  • IoT
  • PIC Microcontrollers
  • Arduino
  • Raspberry Pi
  • Espressif
  • Robotics
  • DOS, Windows, OSX, Linux, iOS, Android, Multi-OS
  • Linux-Apache-PHP-MySQL

Follow Us

J. Luc Paquin – Curriculum Vitae – 2022 English & Español
https://www.jlpconsultants.com/luc/

Web: https://www.donluc.com/
Web: https://www.jlpconsultants.com/
Facebook: https://www.facebook.com/neosteam.labs.9/
YouTube: https://www.youtube.com/channel/UC5eRjrGn1CqkkGfZy0jxEdA
Twitter: https://twitter.com/labs_steam
Pinterest: https://www.pinterest.com/NeoSteamLabs/
Instagram: https://www.instagram.com/neosteamlabs/

Don Luc

Project #12: Robotics – Pololu Ball Caster – Mk22

——

#DonLucElectronics #DonLuc #Robotics #Arduino #Fio #ArduinoProMini #XBee #DCMotor #MotorDriver #Project #Fritzing #Programming #Electronics #Microcontrollers #Consultant

——

Pololu Ball Caster

——

Pololu Ball Caster

——

Pololu Ball Caster

——

Pololu Ball Caster with 1 Inch Plastic Ball and Ball Bearings

This ball caster uses a 1 inch diameter plastic ball and has an overall height of 1.1 inches (29 mm). The two-part housing snaps together to securely enclose the ball and three ball bearings that minimize friction between the ball and the ABS housing.

This ball caster kit includes a two-part black ABS housing, a 1 inch diameter POM plastic ball, three 3 mm × 7 mm × 3 mm ball bearings, and three dowel pins used to hold the ball bearings. When assembled, the ball caster is capable of rolling in any direction with low friction, making it suitable for use as a third contact point for wheeled, differential-drive robots weighing up to around ten pounds.

The base piece of the housing has holes for three mounting screws and slots for ball bearings. The second part of the housing snaps into the base piece to secure the ball and ball bearings. The assembled ball caster has an overall height of 1.1 inches (29 mm).

DL2202Mk02

1 x Fio v3 – ATmega32U4
1 x Arduino Pro Mini 328 – 5V/16MHz
1 x SparkFun FTDI Basic Breakout – 5V
1 x USB/DC Lithium Polymer Battery Charger
1 x Mountable Slide Switch
2 x XBee S1
1 x XBee Explorer Regulated
1 x Lithium Ion Battery – 850mAh
1 x Lithium Ion Battery – 2500mAh
1 x Thumb Joystick
1 x SparkFun Thumb Joystick Breakout
1 x Slide Pot (Small)
1 x Slide Potentiometer Knob
1 x RGB Smart NeoPixel
2 x DRV8835 Dual Motor Driver Carrier
2 x Solarbotics RM2
2 x Pololu Universal Aluminum Mounting Hub 3mm Shaft, #4-40 Holes
2 x Pololu Mini Plastic Gearmotor Bracket Pair – Wide
1 x Steren Model 155
2 x Adafruit Perma-Proto Quarter-Sized Breadboard
15 x Standoff – Metal – #4-40 – 3/8 inch
33 x Screw – #4-40 – 1/4 inch
3 x Nut – Nylon Locknut – #4-40
1 x Pololu Ball Caster – 1 Inch Plastic Ball
1 x HDPE – Black on White – 6 inches x 12 inches x 0.25 inch
1 x SparkFun Cerberus USB Cable

Fio v3 – ATmega32U4 – Transmitter

XBee S1: Transmitter

CH Channel: C
PAN Id: 3333
SH Serial Number: 13A200
SL Serial Number: 40717A1F
CE Coordinator: Coordinator
BD: 9600

RX0 – Digital 0
TX0 – Digital 1
PO0 – Analog A0
JY0 – Analog A1
JY1 – Analog A2
SE0 – Digital 16
VIN – +3.3V
GND – GND

——

DL2202Mk02t.ino

/* ***** Don Luc Electronics © *****
Software Version Information
Project #12: Robotics - Pololu Ball Caster - Mk22
02-02
Transmitter
DL2202Mk02t.ino
1 x Fio v3 - ATmega32U4
1 x XBee S1
1 x Lithium Ion Battery - 850mAh
1 x Thumb Joystick
1 x SparkFun Thumb Joystick Breakout
1 x Slide Pot (Small)
1 x Slide Potentiometer Knob
1 x SparkFun Cerberus USB Cable
*/

// Include the Library Code
// EEPROM library to read and write EEPROM with unique ID for unit
#include <EEPROM.h>

// Communication
unsigned long dTime = 200;

// Slide Pot (Small)
// Select the input pin for the slide pot
// Power
const int iSP1 = A0;
// Power to store the value
int iPower = 0;

// Connections to joystick
// Vertical
const int VERT = A1;
// Horizontal
const int HORIZ = A2;
// Pushbutton
const int SEL = 16;
// Initialize variables for analog and digital values
int vertical;
int horizontal;
int select;

// Software Version Information
// Version
String sver = "12-22t";
// Unit ID Information
// UID
String uid = "";

void loop()
{

  // Thumb Joystick
  isThumbJoystick();
    
  // Process Message
  isProcessMessage();

  delay( dTime );
  
}

getEEPROM.ino

// EEPROM
// is UID
void isUID()
{
  
  // Is Unit ID
  // UID
  uid = "";
  for (int x = 0; x < 5; x++)
  {
    uid = uid + char(EEPROM.read(x));
  }
  
}

getProcessMessage.ino

// Process Message
// isProcessMessage
void isProcessMessage() {
  
   // Loop through serial buffer
   // Print = "<" + vertical + "|" + horizontal + "|" + select + "|" + iValue + "|" + sver + "|" + uid + "*"
      
   Serial1.print( '<'  );
   Serial1.print( vertical );
   Serial1.print( '|' );
   Serial1.print( horizontal );
   Serial1.print( '|' );
   Serial1.print( select );
   Serial1.print( '|' );
   Serial1.print( iPower );
   Serial1.print( '|' );
   Serial1.print( sver );
   Serial1.print( '|' );
   Serial1.print( uid );
   Serial1.println( '*' );

}

getThumbJoystick.ino

// Thumb Joystick
void isThumbJoystick() {

  // Read all values from the joystick
  // Joystick was sitting around 520 for the vertical and horizontal values
  // Will be 0-1023
  vertical = analogRead(VERT);
  // Will be 0-1023
  horizontal = analogRead(HORIZ);
  // Will be HIGH (1) if not pressed, and LOW (0) if pressed
  select = digitalRead(SEL);
  // Read the value
  // Power be 0-1023
  iPower = analogRead( iSP1 );
 
}

setup.ino

// Setup
void setup()
{

  // EEPROM Unit ID
  isUID();
  
  // Pause
  delay(5);
  
  // Make the SEL line an input
  pinMode(SEL, INPUT_PULLUP);
  
  // Open Serial1 port at 9600 baud
  Serial1.begin( 9600 );

  // Pause
  delay(5);

}

——

Arduino Pro Mini 328 – 5V/16MHz – Receiver

XBee S1: Receiver

CH Channel: C
PAN Id: 3333
SH Serial Number: 13A200
SL Serial Number: 4076E2C5
CE Coordinator: End Device
BD: 9600

RX0 – Digital 0
TX0 – Digital 1
M11 – Digital 2
M12 – Digital 3
M21 – Digital 4
M22 – Digital 5
NEO – Digital 6
VIN – +5V
GND – GND

DL2202Mk02r.ino

/* ***** Don Luc Electronics © *****
Software Version Information
Project #12: Robotics - Pololu Ball Caster - Mk22
02-02
Receiver
DL2202Mk02r.ino
1 x Arduino Pro Mini 328 - 5V/16MHz
1 x SparkFun FTDI Basic Breakout - 5V
1 x XBee S1
1 x XBee Explorer Regulated
1 x USB/DC Lithium Polymer Battery Charger
1 x Mountable Slide Switch
1 x Lithium Ion Battery - 2500mAh
1 x RGB Smart NeoPixel
2 x DRV8835 Dual Motor Driver Carrier
2 x Solarbotics RM2
2 x Pololu Universal Aluminum Mounting Hub 3mm Shaft, #4-40 Holes
2 x Pololu Mini Plastic Gearmotor Bracket Pair - Wide
1 x Steren Model 155
2 x Adafruit Perma-Proto Quarter-Sized Breadboard
15 x Standoff - Metal - #4-40 - 3/8 inch
33 x Screw - #4-40 - 1/4 inch
3 x Nut - Nylon Locknut - #4-40
1 x Pololu Ball Caster - 1 Inch Plastic Ball
1 x HDPE - Black on White - 6 inches x 12 inches x 0.25 inch
1 x SparkFun Cerberus USB Cable
*/

// Include the library code:
// EEPROM library to read and write EEPROM with unique ID for unit
#include <EEPROM.h>
// NeoPixels
#include <Adafruit_NeoPixel.h>

// Solarbotics RM2 -> 1
#define MOTOR1_IN1 2
#define MOTOR1_IN2 3
// Solarbotics RM2 -> 2
#define MOTOR2_IN1 4
#define MOTOR2_IN2 5

// Power be 0-1023
int iPower = 0;
String POW = "";
// Joystick was sitting around 520 for the vertical and horizontal values
// Will be 0-1023
// Vertical
int vertical;
String VER = "";
// Horizontal
// Will be 0-1023
int horizontal;
String HOR = "";
// Select
// Will be HIGH (1) if not pressed, and LOW (0) if pressed
int select1 = 0;
String SEL = "";
int firstClosingBracket = 0;
// Map Vertical and Horizontal
int mapVer = 0;
int mapHor = 0;
int iVer = 1;
int iHor = 0;

// NeoPixels
// On digital pin 6
#define PIN 6
// NeoPixels NUMPIXELS = 1
#define NUMPIXELS 1
// Pixels
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
// Red
int red = 0;
// Green
int green = 0;
// Blue
int blue = 0;
// Neopix
int iNeo = 0;
// Value
int zz = 0;

// Process Message
// Start
bool bStart = false;
// End
bool bEnd   = false;
// Variable to store the incoming byte
int incb = 0;
// Message
String msg = "";
// Index
byte in = 0;
int x = 0;

// Software Version Information
String sver = "12-22r";
// Unit ID information
String uid = "";

void loop() {

  // Check for serial messages
  isProcessMessage();

}

getEEPROM.ino

// EEPROM
// isUID
void isUID()
{
  
  // Is Unit ID
  uid = "";
  for (int x = 0; x < 5; x++)
  {
    uid = uid + char(EEPROM.read(x));
  }
  
}

getNeopix.ino

// NeoPixels
// Neopix
void isNeopix() 
{ 

    // Pixels
    pixels.setBrightness( 130 );
    // Pixels color takes RGB values, from 0,0,0 up to 255,255,255
    pixels.setPixelColor( iNeo, pixels.Color(red,green,blue) ); 
    // This sends the updated pixel color to the hardware
    pixels.show(); 
    // Delay for a period of time (in milliseconds)
    delay(50);     
  
}
// isNUMPIXELS
void isNUMPIXELS()
{

  // Neopix Value
  switch ( zz ) {  
    case 0:
      // NeoPixels Green
      // Red
      red = 0;
      // Green
      green = 255;
      // Blue
      blue = 0;
      // Neopix
      iNeo = 0;   
      isNeopix();
      break;  
    case 1:
      // NeoPixels Blue
      // Red
      red = 0;
      // Green
      green = 0;
      // Blue
      blue = 255;
      // Neopix
      iNeo = 0;
      isNeopix();
      break;
    case 2:
      // NeoPixels Red
      // Red
      red = 255;
      // Green
      green = 0;
      // Blue
      blue = 0;
      // Neopix
      iNeo = 0;   
      isNeopix();
      break;
    case 3:
      // NeoPixels Yellow
      // Red
      red = 255;
      // Green
      green = 255;
      // Blue
      blue = 0;
      // Neopix
      iNeo = 0;
      isNeopix();
      break;
    case 4:
      // NeoPixels Magenta
      // Red
      red = 255;
      // Green
      green = 0;
      // Blue
      blue = 255;
      // Neopix
      iNeo = 0;
      isNeopix();
      break;
    case 5:
      // NeoPixels Cyan
      // Red
      red = 0;
      // Green
      green = 255;
      // Blue
      blue = 255;
      // Neopix
      iNeo = 0;
      isNeopix();
      break;
    case 6:
      // NeoPixels White
      // Red
      red = 255;
      // Green
      green = 255;
      // Blue
      blue = 255;
      // Neopix
      iNeo = 0;
      isNeopix();    
      break;
  }
  
}
// isNUMPIXELSoff
void isNUMPIXELSoff()
{

   // Black Off
   // NeoPixels
   // Red
   red = 0;
   // Green
   green = 0;
   // Blue
   blue = 0;
   isNeopix();
 
}

getProcessMessage.ino

// ProcessMessage
// isProcessMessage
void isProcessMessage() {

  // Loop through serial buffer one byte at a time until you reach * which will be end of message
  while ( Serial.available() > 0 ) 
  {
      
      // Read the incoming byte:
      incb = Serial.read();
      
      // Start the message when the '<' symbol is received
      if(incb == '<')
      {

        // Start
        bStart = true;
        in = 0;
        msg = "";
        
      }
      // End the message when the '*' symbol is received
      else if(incb == '*')
      {
        
        // End
        bEnd = true;
        x = msg.length();
        msg.remove( x , 1);
        // Done reading
        
        break;
      }
      // Read the message
      else
      {
        
        // Message
        msg = msg + char(incb);
        in++;

      }
      
   }

   // Start - End
   if( bStart && bEnd)
   {

      // isRM2Motor => Message
      isRM2Motor();
      
      // Start - End
      in = 0;
      msg = "";
      bStart = false;
      bEnd = false;
      vertical;
      horizontal;
      iPower;
      
   }

}

getRM2Motor.ino

// RM2 Motor
// Setup RM2 Motor
void isSetupRM2Motor() {

  // Solarbotics RM2 -> 1
  pinMode(MOTOR1_IN1, OUTPUT);
  pinMode(MOTOR1_IN2, OUTPUT);
  // Solarbotics RM2 -> 2
  pinMode(MOTOR2_IN1, OUTPUT);
  pinMode(MOTOR2_IN2, OUTPUT);
  
}
// isRM2Motor
void isRM2Motor() {

  // msg = vertical + "|" + horizontal + "|" + select + "|" + iValue + "|" + sver + "|" + uid
  firstClosingBracket = 0;
  // Vertical
  firstClosingBracket = msg.indexOf('|');
  VER = msg;
  VER.remove(firstClosingBracket);
  vertical = VER.toInt();
  // Horizontal
  firstClosingBracket = firstClosingBracket + 1;
  msg.remove(0, firstClosingBracket );
  firstClosingBracket = msg.indexOf('|');
  HOR = msg;
  HOR.remove(firstClosingBracket);
  horizontal = HOR.toInt();
  // Select
  firstClosingBracket = firstClosingBracket + 1;
  msg.remove(0, firstClosingBracket );  
  firstClosingBracket = msg.indexOf('|');
  SEL = msg;
  SEL.remove(firstClosingBracket);
  select1 = SEL.toInt();
  // Power
  firstClosingBracket = firstClosingBracket + 1;
  msg.remove(0, firstClosingBracket );    
  firstClosingBracket = msg.indexOf('|');
  POW = msg;
  POW.remove(firstClosingBracket);
  iPower = POW.toInt();

  // Set the direction
  // Joystick was sitting around 520 for the vertical and horizontal values
  // Will be 0-1023
  mapVer = map(vertical, 0, 1023, -512, 512);
  mapHor = map(horizontal, 0, 1023, -512, 512);
  // Power
  iPower = map(iPower, 0, 1023, 30, 200);

  // Vertical and Horizontal 
  if ( mapVer == -512 ) {

      // Down
      // NeoPixels Blue
      zz = 1;
      isNUMPIXELS();
      iVer = 1;
    
  } else if ( mapVer == 512 ) {

      // Up
      // NeoPixels Green
      zz = 0;
      isNUMPIXELS();
      iVer = 2;
 
  } else if ( mapHor == -512 ) {

      // Left
      // NeoPixels Yellow
      zz = 3;
      isNUMPIXELS();
      iVer = 3;
    
  } else if ( mapHor == 512 ) {

      // Right
      // NeoPixels Magenta
      zz = 4;
      isNUMPIXELS();
      iVer = 4;
 
  } else {

    // Stop
    // NeoPixels Red
    zz = 2;
    isNUMPIXELS();
    iVer = 5;
    
  }

  // XBee Car
  switch ( iVer ) {
    case 1:

      // Solarbotics RM2 -> 1 Forward
      digitalWrite(MOTOR1_IN1, LOW);
      analogWrite(MOTOR1_IN2, iPower);
      delay(10);

      // Solarbotics RM2 -> 2 Forward
      digitalWrite(MOTOR2_IN1, LOW);
      analogWrite(MOTOR2_IN2, iPower);
      delay(10);

      break;
    case 2:

      // Solarbotics RM2 -> 1 Backward
      digitalWrite(MOTOR1_IN2, LOW);
      analogWrite(MOTOR1_IN1, iPower);
      delay(10);
      
      // Solarbotics RM2 -> 2 Backward
      digitalWrite(MOTOR2_IN2, LOW);
      analogWrite(MOTOR2_IN1, iPower);
      delay(10);

      break;
    case 3:

      // Right
      // Solarbotics RM2 -> 1 Forward
      digitalWrite(MOTOR1_IN1, LOW);
      analogWrite(MOTOR1_IN2, iPower);
      delay(10);

      // Solarbotics RM2 -> 2 Backward
      digitalWrite(MOTOR2_IN2, LOW);
      analogWrite(MOTOR2_IN1, iPower);
      delay(10);

      break;
    case 4:

      // Left
      // Solarbotics RM2 -> 1 Backward
      digitalWrite(MOTOR1_IN2, LOW);
      analogWrite(MOTOR1_IN1, iPower);
      delay(10);

      // Solarbotics RM2 -> 2 Forward
      digitalWrite(MOTOR2_IN1, LOW);
      analogWrite(MOTOR2_IN2, iPower);
      delay(10);
      
      break;
    case 5:

      // Stop
      // NeoPixels Red
      //zz = 2;
      //isNUMPIXELS();
      // Solarbotics RM2 -> 1
      digitalWrite(MOTOR1_IN1, LOW);
      analogWrite(MOTOR1_IN2, 0);
      delay(10);

      // Solarbotics RM2 -> 2 
      digitalWrite(MOTOR2_IN1, LOW);
      analogWrite(MOTOR2_IN2, 0);
      delay(10); 
      
      break;
 }

}

setup.ino

// Setup
void setup() {

  // Open the serial port at 9600 bps:
  Serial.begin( 9600 );

  // Pause
  delay(5);

  // EEPROM Unit ID
  isUID();
  
  // Pause
  delay(5);

  // Setup Solarbotics RM2 Motor
  isSetupRM2Motor();

  // Pause
  delay(5);
  
  // NeoPixels
  // This initializes the NeoPixel library
  pixels.begin();
  // Delay for a period of time (in milliseconds)
  delay(50);
  // isNUMPIXELS Off
  isNUMPIXELSoff();

}

——

People can contact us: https://www.donluc.com/?page_id=1927

Technology Experience

  • Single-Board Microcontrollers (PIC, Arduino, Raspberry Pi,Espressif, etc…)
  • IoT
  • Robotics
  • Camera and Video Capture Receiver Stationary, Wheel/Tank and Underwater Vehicle
  • Unmanned Vehicles Terrestrial and Marine
  • Research & Development (R & D)
  • Desktop Applications (Windows, OSX, Linux, Multi-OS, Multi-Tier, etc…)
  • Mobile Applications (Android, iOS, Blackberry, Windows Mobile, Windows CE, etc…)
  • Web Applications (LAMP, Scripting, Java, ASP, ASP.NET, RoR, Wakanda, etc…)
  • Social Media Programming & Integration (Facebook, Twitter, YouTube, Pinterest, etc…)
  • Content Management Systems (WordPress, Drupal, Joomla, Moodle, etc…)
  • Bulletin Boards (phpBB, SMF, Vanilla, jobberBase, etc…)
  • eCommerce (WooCommerce, OSCommerce, ZenCart, PayPal Shopping Cart, etc…)

Instructor and E-Mentor

  • IoT
  • PIC Microcontrollers
  • Arduino
  • Raspberry Pi
  • Espressif
  • Robotics
  • DOS, Windows, OSX, Linux, iOS, Android, Multi-OS
  • Linux-Apache-PHP-MySQL

Follow Us

J. Luc Paquin – Curriculum Vitae – 2022 English & Español
https://www.jlpconsultants.com/luc/

Web: https://www.donluc.com/
Web: https://www.jlpconsultants.com/
Facebook: https://www.facebook.com/neosteam.labs.9/
YouTube: https://www.youtube.com/channel/UC5eRjrGn1CqkkGfZy0jxEdA
Twitter: https://twitter.com/labs_steam
Pinterest: https://www.pinterest.com/NeoSteamLabs/
Instagram: https://www.instagram.com/neosteamlabs/

Don Luc

Project #12: Robotics – Steren 155 – Mk21

——

#DonLucElectronics #DonLuc #Robotics #Arduino #Fio #ArduinoProMini #XBee #DCMotor #MotorDriver #Project #Fritzing #Programming #Electronics #Microcontrollers #Consultant

——

Steren 155

——

Steren 155

——

Steren 155

——

Perforated Phenolic Plate

So you finish your electronics projects, such as printed circuits. We know that designing a prototype or electronic project can be a complicated task if you do not have the necessary items to carry it out, so with us you it a phenolic plates of a face, two sided or perforated, ferric chloride, auto-adherable tracks, leaves thermal transfer or permanent ink markers so that your circuits are perfect.

Steren Model 155

Bakelite phenolic plate with copper, 4.5 cm x 4.5 cm, engraved and perforated with 164 orifices for components and 4 for fixing the plate. Ideal for projects or prototypes.

DL2202Mk01

1 x Fio v3 – ATmega32U4
1 x Arduino Pro Mini 328 – 5V/16MHz
1 x SparkFun FTDI Basic Breakout – 5V
1 x USB/DC Lithium Polymer Battery Charger
1 x Mountable Slide Switch
2 x XBee S1
1 x XBee Explorer Regulated
1 x Lithium Ion Battery – 850mAh
1 x Lithium Ion Battery – 2500mAh
1 x Thumb Joystick
1 x SparkFun Thumb Joystick Breakout
1 x Slide Pot (Small)
1 x Slide Potentiometer Knob
1 x RGB Smart NeoPixel
2 x DRV8835 Dual Motor Driver Carrier
2 x Solarbotics RM2
2 x Pololu Universal Aluminum Mounting Hub 3mm Shaft, #4-40 Holes
2 x Pololu Mini Plastic Gearmotor Bracket Pair – Wide
1 x Steren Model 155
2 x Adafruit Perma-Proto Quarter-Sized Breadboard
1 x SparkFun Cerberus USB Cable

Fio v3 – ATmega32U4 – Transmitter

XBee S1: Transmitter

CH Channel: C
PAN Id: 3333
SH Serial Number: 13A200
SL Serial Number: 40717A1F
CE Coordinator: Coordinator
BD: 9600

RX0 – Digital 0
TX0 – Digital 1
PO0 – Analog A0
JY0 – Analog A1
JY1 – Analog A2
SE0 – Digital 16
VIN – +3.3V
GND – GND

DL2202Mk01t.ino

/* ***** Don Luc Electronics © *****
Software Version Information
Project #12: Robotics - Steren 155 - Mk21
02-01
Transmitter
DL2202Mk01t.ino
1 x Fio v3 - ATmega32U4
1 x XBee S1
1 x Lithium Ion Battery - 850mAh
1 x Thumb Joystick
1 x SparkFun Thumb Joystick Breakout
1 x Slide Pot (Small)
1 x Slide Potentiometer Knob
1 x SparkFun Cerberus USB Cable
*/

// Include the Library Code
// EEPROM library to read and write EEPROM with unique ID for unit
#include <EEPROM.h>

// Communication
unsigned long dTime = 200;

// Slide Pot (Small)
// Select the input pin for the slide pot
// Power
const int iSP1 = A0;
// Power to store the value
int iPower = 0;

// Connections to joystick
// Vertical
const int VERT = A1;
// Horizontal
const int HORIZ = A2;
// Pushbutton
const int SEL = 16;
// Initialize variables for analog and digital values
int vertical;
int horizontal;
int select;

// Software Version Information
// Version
String sver = "12-21t";
// Unit ID Information
// UID
String uid = "";

void loop()
{

  // Thumb Joystick
  isThumbJoystick();
    
  // Process Message
  isProcessMessage();

  delay( dTime );
  
}

getEEPROM.ino

// EEPROM
// is UID
void isUID()
{
  
  // Is Unit ID
  // UID
  uid = "";
  for (int x = 0; x < 5; x++)
  {
    uid = uid + char(EEPROM.read(x));
  }
  
}

getProcessMessage.ino

// Process Message
// isProcessMessage
void isProcessMessage() {
  
   // Loop through serial buffer
   // Print = "<" + vertical + "|" + horizontal + "|" + select + "|" + iValue + "|" + sver + "|" + uid + "*"
      
   Serial1.print( '<'  );
   Serial1.print( vertical );
   Serial1.print( '|' );
   Serial1.print( horizontal );
   Serial1.print( '|' );
   Serial1.print( select );
   Serial1.print( '|' );
   Serial1.print( iPower );
   Serial1.print( '|' );
   Serial1.print( sver );
   Serial1.print( '|' );
   Serial1.print( uid );
   Serial1.println( '*' );

}

getThumbJoystick.ino

// Thumb Joystick
void isThumbJoystick() {

  // Read all values from the joystick
  // Joystick was sitting around 520 for the vertical and horizontal values
  // Will be 0-1023
  vertical = analogRead(VERT);
  // Will be 0-1023
  horizontal = analogRead(HORIZ);
  // Will be HIGH (1) if not pressed, and LOW (0) if pressed
  select = digitalRead(SEL);
  // Read the value
  // Power be 0-1023
  iPower = analogRead( iSP1 );
 
}

setup.ino

// Setup
void setup()
{

  // EEPROM Unit ID
  isUID();
  
  // Pause
  delay(5);
  
  // Make the SEL line an input
  pinMode(SEL, INPUT_PULLUP);
  
  // Open Serial1 port at 9600 baud
  Serial1.begin( 9600 );

  // Pause
  delay(5);

}

——

Arduino Pro Mini 328 – 5V/16MHz – Receiver

XBee S1: Receiver

CH Channel: C
PAN Id: 3333
SH Serial Number: 13A200
SL Serial Number: 4076E2C5
CE Coordinator: End Device
BD: 9600

RX0 – Digital 0
TX0 – Digital 1
M11 – Digital 2
M12 – Digital 3
M21 – Digital 4
M22 – Digital 5
NEO – Digital 6
VIN – +5V
GND – GND

DL2202Mk01r.ino

/* ***** Don Luc Electronics © *****
Software Version Information
Project #12: Robotics - Steren 155 - Mk21
02-01
Receiver
DL2202Mk01r.ino
1 x Arduino Pro Mini 328 - 5V/16MHz
1 x SparkFun FTDI Basic Breakout - 5V
1 x XBee S1
1 x XBee Explorer Regulated
1 x USB/DC Lithium Polymer Battery Charger
1 x Mountable Slide Switch
1 x Lithium Ion Battery - 2500mAh
1 x RGB Smart NeoPixel
2 x DRV8835 Dual Motor Driver Carrier
2 x Solarbotics RM2
2 x Pololu Universal Aluminum Mounting Hub 3mm Shaft, #4-40 Holes
2 x Pololu Mini Plastic Gearmotor Bracket Pair - Wide
1 x Steren Model 155
2 x Adafruit Perma-Proto Quarter-Sized Breadboard
1 x SparkFun Cerberus USB Cable
*/

// Include the library code:
// EEPROM library to read and write EEPROM with unique ID for unit
#include <EEPROM.h>
// NeoPixels
#include <Adafruit_NeoPixel.h>

// Solarbotics RM2 -> 1
#define MOTOR1_IN1 2
#define MOTOR1_IN2 3
// Solarbotics RM2 -> 2
#define MOTOR2_IN1 4
#define MOTOR2_IN2 5

// Power be 0-1023
int iPower = 0;
String POW = "";
// Joystick was sitting around 520 for the vertical and horizontal values
// Will be 0-1023
// Vertical
int vertical;
String VER = "";
// Horizontal
// Will be 0-1023
int horizontal;
String HOR = "";
// Select
// Will be HIGH (1) if not pressed, and LOW (0) if pressed
int select1 = 0;
String SEL = "";
int firstClosingBracket = 0;
// Map Vertical and Horizontal
int mapVer = 0;
int mapHor = 0;
int iVer = 1;
int iHor = 0;

// NeoPixels
// On digital pin 6
#define PIN 6
// NeoPixels NUMPIXELS = 1
#define NUMPIXELS 1
// Pixels
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
// Red
int red = 0;
// Green
int green = 0;
// Blue
int blue = 0;
// Neopix
int iNeo = 0;
// Value
int zz = 0;

// Process Message
// Start
bool bStart = false;
// End
bool bEnd   = false;
// Variable to store the incoming byte
int incb = 0;
// Message
String msg = "";
// Index
byte in = 0;
int x = 0;

// Software Version Information
String sver = "12-21r";
// Unit ID information
String uid = "";

void loop() {

  // Check for serial messages
  isProcessMessage();

}

getEEPROM.ino

// EEPROM
// isUID
void isUID()
{
  
  // Is Unit ID
  uid = "";
  for (int x = 0; x < 5; x++)
  {
    uid = uid + char(EEPROM.read(x));
  }
  
}

getNeopix.ino

// NeoPixels
// Neopix
void isNeopix() 
{ 

    // Pixels
    pixels.setBrightness( 130 );
    // Pixels color takes RGB values, from 0,0,0 up to 255,255,255
    pixels.setPixelColor( iNeo, pixels.Color(red,green,blue) ); 
    // This sends the updated pixel color to the hardware
    pixels.show(); 
    // Delay for a period of time (in milliseconds)
    delay(50);     
  
}
// isNUMPIXELS
void isNUMPIXELS()
{

  // Neopix Value
  switch ( zz ) {  
    case 0:
      // NeoPixels Green
      // Red
      red = 0;
      // Green
      green = 255;
      // Blue
      blue = 0;
      // Neopix
      iNeo = 0;   
      isNeopix();
      break;  
    case 1:
      // NeoPixels Blue
      // Red
      red = 0;
      // Green
      green = 0;
      // Blue
      blue = 255;
      // Neopix
      iNeo = 0;
      isNeopix();
      break;
    case 2:
      // NeoPixels Red
      // Red
      red = 255;
      // Green
      green = 0;
      // Blue
      blue = 0;
      // Neopix
      iNeo = 0;   
      isNeopix();
      break;
    case 3:
      // NeoPixels Yellow
      // Red
      red = 255;
      // Green
      green = 255;
      // Blue
      blue = 0;
      // Neopix
      iNeo = 0;
      isNeopix();
      break;
    case 4:
      // NeoPixels Magenta
      // Red
      red = 255;
      // Green
      green = 0;
      // Blue
      blue = 255;
      // Neopix
      iNeo = 0;
      isNeopix();
      break;
    case 5:
      // NeoPixels Cyan
      // Red
      red = 0;
      // Green
      green = 255;
      // Blue
      blue = 255;
      // Neopix
      iNeo = 0;
      isNeopix();
      break;
    case 6:
      // NeoPixels White
      // Red
      red = 255;
      // Green
      green = 255;
      // Blue
      blue = 255;
      // Neopix
      iNeo = 0;
      isNeopix();    
      break;
  }
  
}
// isNUMPIXELSoff
void isNUMPIXELSoff()
{

   // Black Off
   // NeoPixels
   // Red
   red = 0;
   // Green
   green = 0;
   // Blue
   blue = 0;
   isNeopix();
 
}

getProcessMessage.ino

// ProcessMessage
// isProcessMessage
void isProcessMessage() {

  // Loop through serial buffer one byte at a time until you reach * which will be end of message
  while ( Serial.available() > 0 ) 
  {
      
      // Read the incoming byte:
      incb = Serial.read();
      
      // Start the message when the '<' symbol is received
      if(incb == '<')
      {

        // Start
        bStart = true;
        in = 0;
        msg = "";
        
      }
      // End the message when the '*' symbol is received
      else if(incb == '*')
      {
        
        // End
        bEnd = true;
        x = msg.length();
        msg.remove( x , 1);
        // Done reading
        
        break;
      }
      // Read the message
      else
      {
        
        // Message
        msg = msg + char(incb);
        in++;

      }
      
   }

   // Start - End
   if( bStart && bEnd)
   {

      // isRM2Motor => Message
      isRM2Motor();
      
      // Start - End
      in = 0;
      msg = "";
      bStart = false;
      bEnd = false;
      vertical;
      horizontal;
      iPower;
      
   }

}

getRM2Motor.ino

// RM2 Motor
// Setup RM2 Motor
void isSetupRM2Motor() {

  // Solarbotics RM2 -> 1
  pinMode(MOTOR1_IN1, OUTPUT);
  pinMode(MOTOR1_IN2, OUTPUT);
  // Solarbotics RM2 -> 2
  pinMode(MOTOR2_IN1, OUTPUT);
  pinMode(MOTOR2_IN2, OUTPUT);
  
}
// isRM2Motor
void isRM2Motor() {

  // msg = vertical + "|" + horizontal + "|" + select + "|" + iValue + "|" + sver + "|" + uid
  firstClosingBracket = 0;
  // Vertical
  firstClosingBracket = msg.indexOf('|');
  VER = msg;
  VER.remove(firstClosingBracket);
  vertical = VER.toInt();
  // Horizontal
  firstClosingBracket = firstClosingBracket + 1;
  msg.remove(0, firstClosingBracket );
  firstClosingBracket = msg.indexOf('|');
  HOR = msg;
  HOR.remove(firstClosingBracket);
  horizontal = HOR.toInt();
  // Select
  firstClosingBracket = firstClosingBracket + 1;
  msg.remove(0, firstClosingBracket );  
  firstClosingBracket = msg.indexOf('|');
  SEL = msg;
  SEL.remove(firstClosingBracket);
  select1 = SEL.toInt();
  // Power
  firstClosingBracket = firstClosingBracket + 1;
  msg.remove(0, firstClosingBracket );    
  firstClosingBracket = msg.indexOf('|');
  POW = msg;
  POW.remove(firstClosingBracket);
  iPower = POW.toInt();

  // Set the direction
  // Joystick was sitting around 520 for the vertical and horizontal values
  // Will be 0-1023
  mapVer = map(vertical, 0, 1023, -512, 512);
  mapHor = map(horizontal, 0, 1023, -512, 512);
  // Power
  iPower = map(iPower, 0, 1023, 30, 200);

  // Vertical and Horizontal 
  if ( mapVer == -512 ) {

      // Down
      // NeoPixels Blue
      zz = 1;
      isNUMPIXELS();
      iVer = 1;
    
  } else if ( mapVer == 512 ) {

      // Up
      // NeoPixels Green
      zz = 0;
      isNUMPIXELS();
      iVer = 2;
 
  } else if ( mapHor == -512 ) {

      // Left
      // NeoPixels Yellow
      zz = 3;
      isNUMPIXELS();
      iVer = 3;
    
  } else if ( mapHor == 512 ) {

      // Right
      // NeoPixels Magenta
      zz = 4;
      isNUMPIXELS();
      iVer = 4;
 
  } else {

    // Stop
    // NeoPixels Red
    zz = 2;
    isNUMPIXELS();
    iVer = 5;
    
  }

  // XBee Car
  switch ( iVer ) {
    case 1:

      // Solarbotics RM2 -> 1 Forward
      digitalWrite(MOTOR1_IN1, LOW);
      analogWrite(MOTOR1_IN2, iPower);
      delay(10);

      // Solarbotics RM2 -> 2 Forward
      digitalWrite(MOTOR2_IN1, LOW);
      analogWrite(MOTOR2_IN2, iPower);
      delay(10);

      break;
    case 2:

      // Solarbotics RM2 -> 1 Backward
      digitalWrite(MOTOR1_IN2, LOW);
      analogWrite(MOTOR1_IN1, iPower);
      delay(10);
      
      // Solarbotics RM2 -> 2 Backward
      digitalWrite(MOTOR2_IN2, LOW);
      analogWrite(MOTOR2_IN1, iPower);
      delay(10);

      break;
    case 3:

      // Right
      // Solarbotics RM2 -> 1 Forward
      digitalWrite(MOTOR1_IN1, LOW);
      analogWrite(MOTOR1_IN2, iPower);
      delay(10);

      // Solarbotics RM2 -> 2 Backward
      digitalWrite(MOTOR2_IN2, LOW);
      analogWrite(MOTOR2_IN1, iPower);
      delay(10);

      break;
    case 4:

      // Left
      // Solarbotics RM2 -> 1 Backward
      digitalWrite(MOTOR1_IN2, LOW);
      analogWrite(MOTOR1_IN1, iPower);
      delay(10);

      // Solarbotics RM2 -> 2 Forward
      digitalWrite(MOTOR2_IN1, LOW);
      analogWrite(MOTOR2_IN2, iPower);
      delay(10);
      
      break;
    case 5:

      // Stop
      // NeoPixels Red
      //zz = 2;
      //isNUMPIXELS();
      // Solarbotics RM2 -> 1
      digitalWrite(MOTOR1_IN1, LOW);
      analogWrite(MOTOR1_IN2, 0);
      delay(10);

      // Solarbotics RM2 -> 2 
      digitalWrite(MOTOR2_IN1, LOW);
      analogWrite(MOTOR2_IN2, 0);
      delay(10); 
      
      break;
 }

}

setup.ino

// Setup
void setup() {

  // Open the serial port at 9600 bps:
  Serial.begin( 9600 );

  // Pause
  delay(5);

  // EEPROM Unit ID
  isUID();
  
  // Pause
  delay(5);

  // Setup Solarbotics RM2 Motor
  isSetupRM2Motor();

  // Pause
  delay(5);
  
  // NeoPixels
  // This initializes the NeoPixel library
  pixels.begin();
  // Delay for a period of time (in milliseconds)
  delay(50);
  // isNUMPIXELS Off
  isNUMPIXELSoff();

}

——

People can contact us: https://www.donluc.com/?page_id=1927

Technology Experience

  • Single-Board Microcontrollers (PIC, Arduino, Raspberry Pi,Espressif, etc…)
  • IoT
  • Robotics
  • Camera and Video Capture Receiver Stationary, Wheel/Tank and Underwater Vehicle
  • Unmanned Vehicles Terrestrial and Marine
  • Research & Development (R & D)
  • Desktop Applications (Windows, OSX, Linux, Multi-OS, Multi-Tier, etc…)
  • Mobile Applications (Android, iOS, Blackberry, Windows Mobile, Windows CE, etc…)
  • Web Applications (LAMP, Scripting, Java, ASP, ASP.NET, RoR, Wakanda, etc…)
  • Social Media Programming & Integration (Facebook, Twitter, YouTube, Pinterest, etc…)
  • Content Management Systems (WordPress, Drupal, Joomla, Moodle, etc…)
  • Bulletin Boards (phpBB, SMF, Vanilla, jobberBase, etc…)
  • eCommerce (WooCommerce, OSCommerce, ZenCart, PayPal Shopping Cart, etc…)

Instructor and E-Mentor

  • IoT
  • PIC Microcontrollers
  • Arduino
  • Raspberry Pi
  • Espressif
  • Robotics
  • DOS, Windows, OSX, Linux, iOS, Android, Multi-OS
  • Linux-Apache-PHP-MySQL

Follow Us

J. Luc Paquin – Curriculum Vitae – 2022 English & Español
https://www.jlpconsultants.com/luc/

Web: https://www.donluc.com/
Web: https://www.jlpconsultants.com/
Facebook: https://www.facebook.com/neosteam.labs.9/
YouTube: https://www.youtube.com/channel/UC5eRjrGn1CqkkGfZy0jxEdA
Twitter: https://twitter.com/labs_steam
Pinterest: https://www.pinterest.com/NeoSteamLabs/
Instagram: https://www.instagram.com/neosteamlabs/

Don Luc

Categories
Archives