element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • 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
  • Settings
In the Air Design Challenge
  • Challenges & Projects
  • Design Challenges
  • In the Air Design Challenge
  • More
  • Cancel
In the Air Design Challenge
Blog Dust, Temperature and Humidity Monitor Chapter 10
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: engswee
  • Date Created: 27 Jan 2015 4:03 PM Date Created
  • Views 581 views
  • Likes 1 like
  • Comments 1 comment
  • haze_monitor
  • in_the_air
Related
Recommended

Dust, Temperature and Humidity Monitor Chapter 10

engswee
engswee
27 Jan 2015

CC3200 + 430BOOST-SHARP96 with Energia:


In this chapter I will explain the CC3200, 430Boost-sharp96 and Energia. This should save lot of time with given code and example code for the existing hardware and software.

I have try the BBB and BB View 4.3" with no success, not even power up the display to show something @.@ so give up that for now. image

 

CC3200 come with pre install program. User can test and play around with the hardware and software. I will not talk about that here.

All information about this can get from TI webpage or just follow the given info come together with the CC3200.



Hardware & Software:


I will put the hardware and software together because they related to each other.

Let go straight to the point for CC3200 and Energia.


Preparation for the CC3200 to use with Energia. There are few connection setting need to be done at CC3200.

Jumper 8 need to be remove, connection at P1 also need to be remove and make a connection at jumper 8 and JTAG

Picture show connection example.


image


Next is the Energia software where it look similar with the Arduino IDE.

Here just show  the LCD example code to the Energia for CC3200. The given link bellow is the example code.

Link to 430 boost-sharp96 code.Sharp Memory LCD BoosterPack | Energia

image


Unzip the downloaded folder, place them under related hardware libraries folder.

Picture show the example for the folder location for CC3200. Don't put the code under example folder it will not work.


image


After everything done you should be able to program CC3200.

Remove the jumper wire and plug in the LCD module. Power up the board and it should work.

Picture show the example for the LCD display. Sorry for the blur picture image


image



The coming day will be programing, programing and programing.


Now stuck with value to display at the LCD. It took me more then 3 days and I still unable to convert the float value to char for the LCD.

I heard Energia is similar with Arduino. Now I realize that there are very different.

Place the code here in case some one can help image.


//float to charactor convertion
float value = 12.3456789;
char res[10];
sprintf(res, "%4.3f", value);

 

char res1[10];
float valuek = 78.230984;
sprintf(res1, "%4.3f", valuek);

 

myScreen.clearBuffer();
myScreen.setFont(0);
myScreen.text(10, 20, "Voltage:");
myScreen.text(10, 30, res);
myScreen.text(10, 40, res1);
myScreen.flush();

 

//myScreen.clearBuffer();
myScreen.setFont(0);
myScreen.text(10, 10, "Haze Monitor");
myScreen.flush();
delay(2000);


screen show value 2.031. I have no idea at all where this number come from OMG.



image


Old style programing.

I think many people will comment about my programing.

Using the basic function in program to change the float to char(number only). It working at slow speed due to using fix for loop.

This program also just run up to XXXX.XXXX and it should be more then enough for this project.

I will optimize the programing is there is time to do it. For now keep to this first because cannot fine function to convert float to char in Energia.

Any suggestion are welcome to improve this programing image.


//float to char convertion

    float value = sensorValue * a/ b;

    //float value = 9999.9999;// for testing

    int v1000 = 0;

    int v100 = 0;

    int v10 = 0;

    int v1 = 0;

    int v01 = 0;

    int v001 = 0;

    int v0001 = 0;

    int v00001 = 0;

 

    //make the reading to 0.XXX

    int x = 0;

    for (x = 0; x < 100; x ++)

    {

    if (value > 1000)

    {

      value = value - 1000;

      v1000 = v1000 + 1;

    }

    else if (value > 100)

    {

      value = value - 100;

      v100 = v100 +1;

    }

    else if (value > 10)

    {

      value = value - 10;

      v10 = v10 +1;

    }

    else if (value > 1)

    {

      value = value - 1;

      v1 = v1 +1;

    }

    else if (value > 0.1)

    {

      value = value - 0.1;

      v01 = v01 +1;

    }

    else if (value > 0.01)

    {

      value = value - 0.01;

      v001 = v001 +1;

    }

    else if (value > 0.001)

    {

      value = value - 0.001;

      v0001 = v0001 +1;

    }

    else if (value > 0.0001)

    {

      v00001 = v00001 +1;

      value = value - 0.0001;

    }

    else

    {

    

    }

    }

    char res[1];

    sprintf(res, "%d", v1000);

    char res1[1];

    sprintf(res1, "%d", v100);

    char res2[1];

    sprintf(res2, "%d", v10);

    char res3[1];

    sprintf(res3, "%d", v1);

    char res4[1];

    sprintf(res4, "%d", v01);

    char res5[1];

    sprintf(res5, "%d", v001);

    char res6[1];

    sprintf(res6, "%d", v0001);

    char res7[1];

    sprintf(res7, "%d", v00001);

  

  

    myScreen.clearBuffer();

    myScreen.setFont(0);

    myScreen.text(10, 20, "Voltage:");

    myScreen.text(10, 30, res);

    myScreen.text(15, 30, res1);

    myScreen.text(20, 30, res2);

    myScreen.text(25, 30, res3);

    myScreen.text(30, 30, ".");

    myScreen.text(35, 30, res4);

    myScreen.text(40, 30, res5);

    myScreen.text(45, 30, res6);

    myScreen.text(50, 30, res7);

    myScreen.flush();

  


Picture show the output for the given float value. Play around with some value and the output is still acceptable.


image



Previous:

Dust, Temperature and Humidity Monitor Chapter 9

 

Next:

Dust, Temperature and Humidity Monitor Chapter 11




  • Sign in to reply
  • DAB
    DAB over 10 years ago

    Nice detailed update.

     

    DAB

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

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 © 2025 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

  • X
  • Facebook
  • linkedin
  • YouTube