Robot: Line Follower Code: include "kernel.h" #include "kernel_id.h" #include "ecrobot_interface.h" #define PORT_ID NXT_PORT_S1 /* TOPPERS/ATK declarations */ DeclareCounter(SysTimerCnt); DeclareAlarm(AlarmTask2); DeclareEvent(EventTask2); /* nxtOSEK hooks */ void ecrobot_device_initialize(void) { ecrobot_init_nxtcolorsensor(PORT_ID, NXT_COLORSENSOR); // initialize a sensor } void ecrobot_device_terminate(void) { ecrobot_term_nxtcolorsensor(PORT_ID); // terminate a sensor } /* nxtOSEK hook to be invoked from an ISR in category 2 */ void user_1ms_isr_type2(void) { (void)SignalCounter(SysTimerCnt); /* Increment OSEK Alarm Counter */ } /* Alarm executed Task2 */ TASK(Task2) { int X = 100; int Y = 0; int Avg = 50; U8 entr; U8 entr_state = 0; S16 rgb[3]; while(1) { WaitEvent(EventTask2); ClearEvent(EventTask2); // switching the color sensor mode entr = ecrobot_is_ENTER_button_pressed(); ...
Posts
Showing posts from 2017
- Get link
- X
- Other Apps
SQL Stock Market Analysis: The following questions are based on a Stock Data set that have been downloaded from google finance. The dataset dates from as early as 1950(not sure) till 2016. These queries are designed to question the dataset in a way that most of the SQL operations to modify or analyze data are used. 1. List all columns and all rows from the StockData table. SELECT * FROM StockData ; 2. List the TickerSymbol, Industry, TradeDate and the Volume columns from the StockData table. List all rows. SELECT TickerSymbol , Industry , TradeDate , Volume FROM StockData ; 3. List the TickerSymbol, Industry, TradeDate and the Volume columns from the StockData table. List only the rows that have a volume of more thirty million shares traded. SELECT TickerSymbol , Industry , TradeDate , Volume FROM StockData WHERE Volume > ...