element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Members
    Members
    • Benefits of Membership
    • Achievement Levels
    • Members Area
    • Personal Blogs
    • Feedback and Support
    • What's New on element14
  • Learn
    Learn
    • Learning Center
    • eBooks
    • STEM Academy
    • Webinars, Training and Events
    • More
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • More
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • More
  • Products
    Products
    • Arduino
    • Dev Tools
    • Manufacturers
    • Raspberry Pi
    • RoadTests & Reviews
    • Avnet Boards Community
    • More
  • Store
    Store
    • Visit Your Store
    • Choose Another Store
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
Intel
  • Products
  • Manufacturers
  • Intel
  • More
  • Cancel
Intel
Blog CapperLabs Greenhouse Controller - Blog 3 - Intel Edison
  • Blog
  • Forum
  • Documents
  • Events
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Intel requires membership for participation - click to join
Blog Post Actions
  • Subscribe by email
  • More
  • Cancel
  • Share
  • Subscribe by email
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
Author: rsc
Date Created: 13 Feb 2017 4:15 PM
Views: 87
Likes: 3
Comments: 0
  • intel
  • greenhouse
  • edison
  • intel_project
Related
Recommended

CapperLabs Greenhouse Controller - Blog 3 - Intel Edison

rsc
rsc
13 Feb 2017
CapperLabs Greenhouse Controller Table of Contents
Blog 1 Introduction
Blog 2 System Components
Blog 3 Intel Edison
Blog 4 Grove-y
Blog 5 Round and Round
Blog 6 Automatic Vent

 

 

I've been trying out some code on the Intel Edison Arduino board with varying levels of success.

I'd like to be able to see the status of various controls and sensors locally, so I've been trying to interface to

a Sparkfun Nokia 6100 display.  None of the published libraries would work as found, but after a few hours of code mods,

I was able to get the interface going.

 

One of the code changes was the control pin definitions in SparkFunColorLCDShield.h:

#define LCD_PIN_RES    8  // D8

#define LCD_PIN_CS      9  // D9

#define LCD_PIN_DIO   11  // D11

#define LCD_PIN_SCK   13  // D13

There are also two macros for changing the pin states that don't work with the Edison board because they are defined by PORT and BIT locations :

// #define sbi(var, mask)   ((var) |= (uint8_t)(1 << mask))

// #define cbi(var, mask)   ((var) &= (uint8_t)~(1 << mask))

These lines were commented out.

The rest of the code issues were with SparkFunColorLCDShield.cpp:

The original code sets pin direction (Input/Output) using DDRB, DDRC commands which don't work with the Edison.

Those lines needed to be changed to use the pinMode() command.

pinMode(LCD_PIN_RES, OUTPUT);

pinMode(LCD_PIN_CS, OUTPUT);

pinMode(LCD_PIN_DIO, OUTPUT);

pinMode(LCD_PIN_SCK, OUTPUT);

All the sbi() and cbi() calls needed to be changed to:

digitalWrite(LCD_PIN_XXX, HIGH); //for sbi()

digitalWrite(LCD_PIN_XXX, LOW);  //for cbi()

After these changes, the example would compile and run.

Anonymous
Element14

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2022 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • Facebook
  • Twitter
  • linkedin
  • YouTube