Changeset 243


Ignore:
Timestamp:
Jun 15, 2016, 4:09:12 PM (8 years ago)
Author:
ertl-honda
Message:

IoTパッケージの内容に合わせて更新

Location:
rtos_arduino/trunk/examples/NCESIoT_RTOS
Files:
13 added
3 edited

Legend:

Unmodified
Added
Removed
  • rtos_arduino/trunk/examples/NCESIoT_RTOS/Makefile

    r242 r243  
    6262APPL_COBJS   +=
    6363
     64APPL_DIR     += ./ChainableLED
     65APPL_CXXOBJS += ChainableLED.o
     66APPL_COBJS   +=
     67
    6468include $(RCA_DIR)/lib/Makefile.rca
  • rtos_arduino/trunk/examples/NCESIoT_RTOS/rca_app.cpp

    r242 r243  
    66#include <Digital_Light_TSL2561.h>
    77#include <SeeedOLED.h>
     8#include <ChainableLED.h>
     9
     10#define LED_PIN  4
     11
     12void setup()
     13{
     14    Serial.begin(115200);
     15    pinMode(LED_PIN, OUTPUT);
     16}
     17
     18void loop()
     19{
     20    digitalWrite(LED_PIN, HIGH);   // turn the LED on (HIGH is the voltage level)
     21    delay(1000);                   // wait for a second
     22    digitalWrite(LED_PIN, LOW);    // turn the LED off by making the voltage LOW
     23    delay(1000);                   // wait for a second   
     24}
     25
    826
    927#define TOUCH_PIN 3
     
    1129int is_update_oled;
    1230
    13 void setup()
     31void task1_setup()
    1432{
    15     Serial.begin(115200);
    1633    Wire.begin();
    1734    TSL2561.init();
     
    2340}
    2441 
    25 void loop()
    26 {   
     42void task1_loop()
     43{
     44    int lux;
     45
     46    lux = TSL2561.readVisibleLux();
    2747    Serial.print("The Light value is: ");
    28     Serial.println(TSL2561.readVisibleLux());
     48    Serial.println(lux);
    2949
    3050    if (is_update_oled == 1) {
    3151        wai_sem(OLED_SEM);
    32         SeeedOled.clearDisplay();
    33         SeeedOled.putNumber(TSL2561.readVisibleLux());
     52        SeeedOled.setTextXY(0, 0);       
     53        SeeedOled.putNumber(lux);
     54        SeeedOled.putString("    ");       
    3455        sig_sem(OLED_SEM);
    3556    }
     
    4566#endif /* USE_INTERRUPT */
    4667
    47 void task1_setup()
     68void task2_setup()
    4869{
    4970    pinMode(TOUCH_PIN, INPUT_PULLUP);
     
    5374}
    5475
    55 void task1_loop()
     76void task2_loop()
    5677{
    5778#ifdef USE_INTERRUPT   
     
    7596    }
    7697}
     98
     99#define NUM_LEDS  1
     100
     101ChainableLED leds(8, 9, NUM_LEDS);
     102
     103void task3_setup()
     104{
     105    leds.init();
     106}
     107
     108float hue = 0.0;
     109boolean up = true;
     110int count = 0;
     111
     112void task3_loop()
     113{
     114    for (byte i=0; i<NUM_LEDS; i++)
     115      leds.setColorHSB(i, hue, 1.0, 0.5);
     116   
     117    delay(50);
     118   
     119    if (up)
     120      hue+= 0.025;
     121    else
     122      hue-= 0.025;
     123   
     124    if (hue>=1.0 && up)
     125      up = false;
     126    else if (hue<=0.0 && !up)
     127      up = true;
     128}
  • rtos_arduino/trunk/examples/NCESIoT_RTOS/rca_app.h

    r242 r243  
    22#define _RCA_APP_H_
    33
    4 #define RCA_NUM_TASK 1
     4#define RCA_NUM_TASK 3
    55
    66#endif /* _RCA_APP_H_ */
Note: See TracChangeset for help on using the changeset viewer.