text:
Q: Google Maps Fragment returning null inside a fragment So I have an empty fragment that contains a map fragment. Whenever I try to activate the fragment containing the map, my app crashes and returns a null pointer error on this line:
map = ((MapFragment) getFragmentManager().findFragmentById(R.id.map))
                .getMap();

Full Error message:
java.lang.NullPointerException: Attempt to invoke virtual method 'com.google.android.gms.maps.GoogleMap com.google.android.gms.maps.MapFragment.getMap()' on a null object reference
            at com.collusion.serviceassistant.ReturnVisitDetails.onViewCreated(ReturnVisitDetails.java:39)
            at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:904)
            at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1062)
            at android.app.BackStackRecord.run(BackStackRecord.java:684)
            at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1447)
            at android.app.FragmentManagerImpl$1.run(FragmentManager.java:443)
            at android.os.Handler.handleCallback(Handler.java:733)
            at android.os.Handler.dispatchMessage(Handler.java:95)
            at android.os.Looper.loop(Looper.java:136)
            at android.app.ActivityThread.main(ActivityThread.java:5001)
            at java.lang.reflect.Method.invoke(Native Method)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)

Here is my fragment code:
import android.app.Activity;
import android.app.Dialog;
import android.net.Uri;
import android.os.Bundle;
import android.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.GooglePlayServicesUtil;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.MapFragment;
import com.google.android.gms.maps.MapView;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.Marker;
import com.google.android.gms.maps.model.MarkerOptions;

public class ReturnVisitDetails extends Fragment {

    static final LatLng HAMBURG = new LatLng(53.558, 9.927);
    static final LatLng KIEL = new LatLng(53.551, 9.993);
    private GoogleMap map;
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View rootView = inflater.inflate(R.layout.fragment_return_visit_add, container, false);
        return rootView;
    }

    public void onViewCreated(View view, Bundle savedInstanceState)
    {
        // Get a handle to the Map Fragment
        map = ((MapFragment) getFragmentManager().findFragmentById(R.id.map))
                .getMap();
        Marker hamburg = map.addMarker(new MarkerOptions().position(HAMBURG)
                .title("Hamburg"));
        Marker kiel = map.addMarker(new MarkerOptions()
                .position(KIEL)
                .title("Kiel")
                .snippet("Kiel is cool")
                .icon(BitmapDescriptorFactory
                        .fromResource(R.drawable.ic_launcher)));

        // Move the camera instantly to hamburg with a zoom of 15.
        map.moveCamera(CameraUpdateFactory.newLatLngZoom(HAMBURG, 15));

        // Zoom in, animating the camera.
        map.animateCamera(CameraUpdateFactory.zoomTo(10), 2000, null);
    }
}

And my parent fragment XML layout:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.collusion.serviceassistant.ReturnVisitDetails"
    android:background="#009688">

    <fragment
        android:id="@+id/map"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        class="com.google.android.gms.maps.MapFragment" />

</RelativeLayout>

Anyone have an idea why the map fragment is returning null?
EDIT: So now I have this code to initialize the map:
MapFragment mapFragment = new MapFragment();
        FragmentTransaction transaction = getChildFragmentManager().beginTransaction();
        transaction.add(R.id.rl_map_container, mapFragment).commit();
        map = mapFragment.getMap();
        Marker hamburg = map.addMarker(new MarkerOptions().position(HAMBURG)
                .title("Hamburg"));
        Marker kiel = map.addMarker(new MarkerOptions()
                .position(KIEL)
                .title("Kiel")
                .snippet("Kiel is cool")
                .icon(BitmapDescriptorFactory
                        .fromResource(R.drawable.ic_launcher)));

        // Move the camera instantly to hamburg with a zoom of 15.
        map.moveCamera(CameraUpdateFactory.newLatLngZoom(HAMBURG, 15));

        // Zoom in, animating the camera.
        map.animateCamera(CameraUpdateFactory.zoomTo(10), 2000, null);

And it still returns a null pointer value

A: I searched for a lot of threads on this as I was having the same issue with older google play services. As Victor said that your class extends from fragment and it has to use another fragment defined in the layout, So best approach will be to use getChildFragmentManager() instead of getSupportFragmentManager().
Also getMap() method is deprecated now as mentioned in google docs. Please refer this for more:-
https://developers.google.com/android/reference/com/google/android/gms/maps/MapFragment.html#getMap()
Below is the working code I have tested on various devices of older play services. This will generate the default message in case of device having older google play services and in case object of GoogleMap returns null:
class MyFragment extends Fragment
{
      SupportMapFragment myMapFragment;
    GoogleMap myMap;
    View convertView;
    FragmentManager fm;
    public View onCreateView(LayoutInflater inflater, ViewGroup container,  Bundle savedInstanceState) {

    convertView=inflater.inflate(R.layout.mymap,null);
    fm=getChildFragmentManager();
        myMapFragment=(SupportMapFragment) fm.findFragmentById(R.id.myMapId);

        // here instead of using getMap(), we are using getMapAsync() which returns a callback and shows map only when it gets ready.
        //it automatically checks for null pointer or older play services version, getMap() is deprecated as mentioned in google docs.

        myMapFragment.getMapAsync(new OnMapReadyCallback() {

            @Override
            public void onMapReady(GoogleMap googlemap) {
                // TODO Auto-generated method stub
                myMap=googlemap;
                startMap();
            }
        });

    return convertView;
    }

}

See this thread for more info.

A: Could this be an issue of migrating to a target sdk version of 21? If so, the following solution may be of interest to you:
MapFragment or MapView getMap() returns null on Lollipop

A: I have solved the issue.
this line when I have a viewpager:
mMap = ((SupportMapFragment) MainActivity.fragmentManager
                .findFragmentById(R.id.mapView)).getMap();

you have to change to this:
  mMap = ((SupportMapFragment) getChildFragmentManager()
            .findFragmentById(R.id.mapView)).getMap();

A: Your class extends from Fragment, and you are using a Fragment declared in the layout, but nested fragment only work when they are added dynamically.
So, you have two options:
1) Extending from FragmentAcivity instead of Fragment and applying the proper methods.
2) Add the Fragment dynamically, as follow:
//ReturnVisitDetails
MapFragment mapFragment = new MapFragment();
FragmentTransaction transaction = getChildFragmentManager().beginTransaction();
transaction.add(R.id.rl_map_container, mapFragment).commit();

//Layout
<FrameLayout
        android:id="@+id/rl_map_container"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

--UPDATED--
A complete example to use Google Maps inside a Fragment:
//TestFragmentActivity
public class TestFragmentActivity extends android.support.v4.app.FragmentActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.test_fragment_activity);
    }

}

//TestFragment
public class TestFragment extends android.support.v4.app.Fragment {

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View rootView = inflater.inflate(R.layout.test_fragment, container, false);

        CustomMapFragment mapFragment = new CustomMapFragment();
        FragmentTransaction transaction = getChildFragmentManager().beginTransaction();
        transaction.add(R.id.map_container, mapFragment).commit();
        return rootView;
    }

}

//CustomMapFragment
public class CustomMapFragment extends com.google.android.gms.maps.SupportMapFragment {

    private final LatLng HAMBURG = new LatLng(53.558, 9.927);

    @Override
    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);

        GoogleMap googleMap = getMap();
        googleMap.addMarker(new MarkerOptions().position(HAMBURG).title("Hamburg"));
        googleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(HAMBURG, 15));
        googleMap.animateCamera(CameraUpdateFactory.zoomTo(10), 2000, null);
    }

}

//test_fragment_activity.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">

    <fragment
        android:id="@+id/map"
        class="your_package.TestFragment"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

</RelativeLayout>

//test_fragment.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">

    <FrameLayout
        android:id="@+id/map_container"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>

</RelativeLayout>

A: This issue happened to me when I tried to port my Eclipse project to Android Studio project.
java.lang.NullPointerException: Attempt to invoke virtual method 'com.google.android.gms.maps.GoogleMap com.google.android.gms.maps.SupportMapFragment.getMap()' on a null object reference

I used it with a Fragment Activity like this:
((SupportMapFragment) getActivity().getSupportFragmentManager().findFragmentById(R.id.mapToday)).getMap();

However, the problem was, earlier I was using a specific version of Google Play Services (4.3.23).
But the Gradle build select the most recent version (compile 'com.google.android.gms:play-services:+')
I tried some other specific version like (6.1.71). But still gave null point exception.
I used the same old version as I used before and it worked.
compile 'com.google.android.gms:play-services:4.3.23'

This works for me as a temporary solution. However, this will be a problem when I need to update to a
new play services library.
It seems that there is no specific map library with this version available for Gradle build
when I try like this:
compile 'com.google.android.gms:play-services-maps:4.3.23'

A: Try using SupportMapFragment instead of MapFragment. This code works for me for a Fragment, just tried it:
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.Marker;
import com.google.android.gms.maps.model.MarkerOptions;

public class MapFragment extends Fragment {

private GoogleMap map;
static final LatLng HAMBURG = new LatLng(53.558, 9.927);
static final LatLng KIEL = new LatLng(53.551, 9.993);

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
        Bundle savedInstanceState) {

    View rootView = inflater.inflate(R.layout.fragment_map, container,
            false);

    // Get a handle to the Map Fragment
    map = ((SupportMapFragment) getFragmentManager().findFragmentById(
            R.id.map)).getMap();
    Marker hamburg = map.addMarker(new MarkerOptions().position(HAMBURG)
            .title("Hamburg"));
    Marker kiel = map.addMarker(new MarkerOptions()
            .position(KIEL)
            .title("Kiel")
            .snippet("Kiel is cool")
            .icon(BitmapDescriptorFactory
                    .fromResource(R.drawable.ic_launcher)));

    // Move the camera instantly to hamburg with a zoom of 15.
    map.moveCamera(CameraUpdateFactory.newLatLngZoom(HAMBURG, 15));

    // Zoom in, animating the camera.
    map.animateCamera(CameraUpdateFactory.zoomTo(10), 2000, null);

    return rootView;
}
}

and your layout:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" >

<fragment
    android:id="@+id/map"
    android:name="com.example.test.MapFragment"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    class="com.google.android.gms.maps.SupportMapFragment" />

</RelativeLayout>

A: The problem may be related to the fact that your targetSdkVersion is higher than the version of Android Support Library used.
That was my case, in one of the projects we've been working on targetSdkVersion was 21, while Support Library version was 19.0.0. Changing targetSdkVersion to 19 fixed the problem.

A: I can face same problem but finally i can solve that error.Now Map is Properly showing...
=> Call initilizeMap() Method in Fragment within a onCreateView() method...
=> Declare Global Variable like ,
private GoogleMap googleMap;

 private void initilizeMap() {
    try {

        // Changing marker icon
        // marker.icon(BitmapDescriptorFactory.fromResource(R.drawable.my_marker_icon)));

        // adding marker
        if (googleMap == null) {
            googleMap = ((MapFragment)getActivity().getFragmentManager()
                    .findFragmentById(R.id.map)).getMap();

            // create marker
            MarkerOptions marker = new MarkerOptions().position(
                    new LatLng(latitude, longitude)).title(
                    "YourCare");

            // Changing marker icon
            MarkerOptions icon = marker.icon(BitmapDescriptorFactory
                    .defaultMarker(BitmapDescriptorFactory.HUE_ROSE));
            // adding marker

            LatLng latLng = new LatLng(latitude, longitude);
            CameraUpdate cameraUpdate = CameraUpdateFactory.newLatLngZoom(
                    latLng, 15);
            googleMap.animateCamera(cameraUpdate);
            // locationManager.removeUpdates(this);

            googleMap.addMarker(marker);
            googleMap.setMyLocationEnabled(true);
            // check if map is created successfully or not
            if (googleMap == null) {
                Toast.makeText(getActivity(),
                        "Sorry! unable to create maps", Toast.LENGTH_SHORT)
                        .show();
            }

        }
    } catch (Exception e) {
        System.out.print("Error :" + e.getMessage());
    }

}


A unified nomenclature system for the nuclear receptor superfamily.
2. NISHIKAWA, J-I., KITAURA, M., IMAGAWA, M. AND NISHIHARA, T.
NUCLEIC ACIDS RES. 23(4) 606-611 (1995).
3. DE VOS, P., SCHMITT, J., VERHOEVEN, G. AND STUNNENBERG, G.
NUCLEIC ACIDS RES. 22(7) 1161-1166 (1994).
4. OHKURA, N., HIJIKURO, M., YAMAMOTO, A. AND MIKI, K.
5. LAW, S.W., CONNEELY, O.M., DEMAYO, F.J. AND O'MALLEY, B.W.
Identification of a new brain-specific transcription factor, NURR1.
6. WILSON, T.E., PAULSEN, R.E., PADGETT, K.A. AND MILBRANDT, J.
GUSTERSON, B.A., SHIPLEY, J. AND COOPER, C.S.
gene superfamily, in a human myxoid chondrosarcoma.
components; hormone binding greatly increases receptor affinity.
complex set of names used to describe superfamily members .
by chromosomal translocations that involve the NOR protein .
NR42_MOUSE  ORPHAN NUCLEAR RECEPTOR NURR1 (NUR-RELATED FACTOR 1) - MUS MUSCULUS (MOUSE).
O97726      NEURON-DERIVED ORPHAN RECEPTOR-1 ALFA - SUS SCROFA (PIG).
O97727      NEURON-DERIVED ORPHAN RECEPTOR-1 BETA - SUS SCROFA (PIG).
Q14979      NUCLEAR RECEPTOR - HOMO SAPIENS (HUMAN).
Q15627      TR3BETA - HOMO SAPIENS (HUMAN).


Jim's Cleaners Freemantle, Perth: Home cleaning, office cleaning, business cleaning and vacate cleaning.
Looking for a reliable and professional Window Cleaner who can also cater to your Property Maintenance needs? Look no further, you have struck gold with Hypacleen. Call today.
Window Cleaning throughout the Perth Metro. Professional Window Cleaning for Domestic, Office & Shop-Fronts up to 2 Storeys. Over 10 Years Window Cleaning Experience assures you of a quality job.
BENEFIT FROM CLEAN WINDOWS when you choose ENVIRO-GREEN-CLEAN! Window Cleaning, home maintenance services, end of lease cleans, builders cleans and more in Perth, Western Australia.
Residential & Commercial Window Cleaning. All Areas.
We use premium grade materials and standardised techniques to give full satisfaction to the client.
Riklean thoroughly cleans offices, windows, carpets and cars. Services available to commercial businesses, real estate agents, strata managers and individual households. "More than just a cleaner!"
Carpet, window & office cleaning with no chemicals used, experience the difference with Bioffice.
Payne's Window Cleaning offers professional residential or commercial window cleaning. Servicing Perth's Southern suburbs. Fully insured, local family operated business. Call us!
Domestic Doctors is a privately owned cleaning business which employs professional cleaning contractors who are mature, responsible, reliable and efficient.
Lowest house cleaning rates, end of lease cleaning, window cleaning, vacate cleaning, Fremantle highest quality of services.
Lowest house cleaning rates Fremantle, end of lease cleaning, Fremantle house cleaning, Fremantle window cleaning, Fremantle vacate cleaning, Fremantle highest quality of services.
We look forward to meeting all your cleaning requirements!


text:
UPDATE: Store clerk says attack felt like it wouldn't end
Police need your help finding 4 men accused of robbing a convenience store.
UPDATE: The 7-Eleven clerk who was viciously beaten is speaking about the incident.
Ron Barritt was working inside the store near Nellis and Lake Mead boulevards when a man with a gun walked in and started beating him. All Barritt could do was lay there, pretend he was knocked out and pray the attack would end.
"I was just hoping to make it out of there alive," says Barritt, who didn't see the attack coming. "He come behind the counter and he just ambushed me."
Barritt was working alone on Monday, just after midnight, when a man wearing a black hoodie walked in. Nothing seemed unusual. Then, without saying a word, the guy pulled out a gun and punched and kicked Barritt to the ground.
"He started running at me and that was that," Barritt says.
The vicious attack lasted for 20 minutes. Two other men joined the beating.
"At one point I had opened my eyes and the one dude was staring at me and he beat me down again," Barritt says.
All Barritt could do was close his eyes, try to cover up and think about his wife, children and grandkids.
"It was like they were never leaving," Barritt says.
His attackers finally took off, leaving Barritt with a concussion and a black eye.
"My head hurts a lot. I got a constant headache that goes on," he says.
The criminals never tried to cover their faces.
"They didn't care," says Barritt, who now has light sensitivity and has to cover his eyes and wear sunglasses.
"If they wanted to rob me, all they would've had to do is say 'hey, give me the money.' That would've been it," Barritt says.
The attackers are still on the run.
Barritt says he doesn't wish them any ill will. He just wants the crooks caught and prosecuted.
Believe it or not, Barritt says, he's going right back to work at the 7-Eleven.
ORIGINAL STORY
LAS VEGAS (KTNV) -- Police need your help finding 4 men accused of robbing a convenience store.
It happened on Jan. 22 at a store located in the 1900 block of Nellis Boulevard near Lake Mead Boulevard.
The suspects entered the business and pistol whipped the lone store clerk, causing him to fall to the ground.
Once on the ground, the victim was kicked several times until he was knocked unconscious. The suspects brazenly took numerous items from the store including cash, merchandise and even the clerk's wallet and cell phone.
A citizen, not knowing what had occurred, encountered the severely injured employee and summoned police.
13 Action News showed the video to Darnell Jones-Martin, a regular customer, who couldn't believe what she was seeing.
"Oh my goodness!" Jones-Martin says. "It shakes me up very bad. They're here to provide a service for us and they're not safe. It's just sad. It makes me want to cry."
The store owner did not want 13 Action News to use his name. But he spoke with us on the phone.
"Thieves and robbers have no fear of law at all," the owner says. "I really have no words to express how scary this can be."
The owner tells us the clerk is out of the hospital and healing, but he suffered contusions on his head back and shoulders.
"He's totally traumatized."
We talked with the wife of the victim. She tells us he's heavily right sedated but recovering.
The first suspect is described as a black male adult, approximately 25 years of age standing 6' tall and weighing about 220 pounds. He was last seen wearing green pants and a black hooded sweatshirt with "Rebels Athletics" on the front and "Babyface 32" on the back.
The suspect appears to be wearing a long white undershirt containing letters reading "BEENTRILL#".
The second suspect is described as a black male adult, approximately 25 years of age standing 5'8" tall and weighing about 170 pounds.
He was last seen wearing dark pants and a gray hooded sweatshirt with "SLW" lettering on the left shoulder.
The third suspect is described as a black male adult, approximately 25 years of age standing 5'8" tall and weighing about 150 pounds.
He was last seen wearing dark pants and white long sleeved dress shirt. He was wearing a gold chain with a dollar sign pendant. The suspect has a notable flat-top faded haircut.
The fourth suspect is described as a black male adult, approximately 25 years of age standing 5'8" tall and weighing about 150 pounds with a thin build.
He was last seen wearing dark pants and a gray and black hooded sweatshirt with a camouflage pattern.
If you have any information on this case, please call Crime Stoppers at 702-385-5555.

redpajama_set_name: RedPajamaCommonCrawl


text:
Q: How to check bytes value is int or float? Let's assume that bytes contain int or float only.
It's my case.
Is there any way to know the value in bytes is int or float in C#?

The bytes can contain both int format or float format( sign + exponent + fraction ).
To read data from bytes using
BitConverter.ToInt32 and BitConverter.ToSingle makes huge difference.
byte[]  src = new byte[4];

// float or int assignment to src bytes
// ...
// ...

// way to know the value is int or float?
if(/* src is int format */)
    int valueInt = BitConverter.ToInt32(src, 0);
else
    float valueFloat = BitConverter.ToSingle(src, 0);

A: "Is there any way to know the value in bytes is int or float in C#?"
Heck No!
Even if you knew that the bytes in memory were a string, you could not read or even define wehre it ends without also knowing wich of the hundreds of possible encodings were used:
http://www.joelonsoftware.com/articles/Unicode.html
The same bytes can be a valid bitmap or the most dangerous virus of our time, it all depends how they are interpreted (as a bitmap or executeable code). File-endings in windows are used to define how any set of bytes should be interpreted (wich programm it should be handed too). A lot of common formats carry a way to be "identified" as the first binary information.
Carrying type information and other stuff needed for interpretation is usually the reason we transmit stuff via De(Sertialsiation) like XML, JSON, etc.

redpajama_set_name: RedPajamaStackExchange


Short, easy-to-teach activities designed to be completed in order, using TI-84 Plus CE and TI-Innovator™ technology.
In this first lesson for Unit 1, you will learn about working in the Program Editor to write a program that controls a light on the TI-Innovator™ Hub.
Connect the TI-Innovator™ Hub to the TI-84 Plus CE. The calculator will turn on. On the TI-Innovator™ Hub, a green light illuminates, indicating that the TI-Innovator™ Hub has power and is ready.
When learning to program a calculator with the TI-Innovator™ Hub, you will be learning to program in two separate but connected worlds: the calculator and the TI-Innovator™ Hub.
The Send( command is used to send commands the TI-Innovator™ Hub that produce a physical reaction (lighting up a light, making a sound, turning on a motor, etc.).
The TI-Innovator™ Hub commands are also found on the [prgm] key under the HUB menu.
Your first program will tell the TI-Innovator™ Hub to turn on the red LIGHT (LED) for 5 seconds.
To begin writing a new program, press [prgm] > New.
Type a name for the program (we use the name LIGHT1 here), and press enter.
LIGHT is the name of the red LED.
Press the [prgm] key, and select the HUB menu.
Select the Send("SET... menu item.
Then, select the LIGHT from the Send("SET... submenu.
Finish the statement by completing the rest of the command.
To access ON and TIME, press the [prgm] key, select the HUB menu, and then select the Settings submenu.
Enter the number 5 for 5 seconds.
Don't forget to close the quotation marks ([alpha] [+]) and parentheses at end of the statement. If needed, the space character is on the 0 (zero) key.
The complete program is shown to the right.
The Send( ) command will send the string (the text in quotes) to the TI-Innovator™ Hub.
Make sure your TI-Innovator™ Hub is connected to the calculator.
Press [ALPHA] [GRAPH] (F5*), and then [ENTER] to select 'Execute Program'. This quits the Program Editor and runs the program on the home screen.
* The F5 MENU key, first included in OS v5.3, is only available from within the Program Editor. It contains some additional useful editing tools like Undo Clear, Cut, Copy, and Paste, and more. These are very handy new features that you will appreciate as you write more complex programs.
If the command is written correctly, the LIGHT (the red LED) will light up for 5 seconds. If there's an error in the TI-Innovator Hub instruction, the red light flashes once and a beep will sound.
The calculator displays 'Done' when the program ends. Notice that the program actually ends before the light goes off. To make the program end when the light goes off, we have to tell the calculator to Wait as long as the light is on.
To add a statement to the program, we need to edit it.
Press [prgm] and arrow over to EDIT.
Select your program name from the list.
Arrow down to the end of the program code.
Add the statement Wait 5 by pressing [prgm], arrowing down to Wait in the CTL menu, and pressing enter. Then, enter the number 5.
Run the program again. If the program was the last item on the home screen, simply press [enter] to rerun it. The program will end at roughly the same time the red light goes off.
We can remove the TIME element of the Send instruction and control the timing using the Wait command in the calculator. Since the LED will stay on once it is turned on, you will also have to turn the light OFF in your program.
Add statements to the program to make the light blink many times.
In this second lesson for Unit 1, you will learn about input to a program and controlling the COLOR LED on the TI-Innovator™ Hub.
The COLOR LED (light emitting diode) has three color 'channels': red, green, and blue. This is often referred to as an "RGB LED". Computer screens, phone screens and TV screens all use a large number of these LEDs to create images.
To get a particular color, you have to mix the right amounts of these three colors red, green and blue. Many other colors are possible with the right mix of these three primary colors.
In this program, you will experiment with the COLOR LED. You will enter numeric red, green, and blue values into the program to direct the LED to light up in the color that you chose.
In addition to studying the COLOR LED, we are introducing the first program command to accept input from the user while the program is running: Prompt.
The Prompt statement allows the user to enter a value for a variable while the program is running. It's called Prompt because it provides a visual message (the name of the variable and a question mark) when it is being processed. In response, the user enters a value for the variable.
The numeric variables in the TI-84 Plus CE are the letters A..Z and Ɵ (theta). Real or complex numbers can be stored.
In this program, we will use Prompt to ask for red, green, and blue numeric values (0 – 255, inclusive) and then send them to the COLOR LED. In the interest of efficiency, we'll prompt for all three variables in the one statement.
Press [prgm] > New, type a name for the program (we use the name COLOR1 here), and press enter.
Add a ClrHome statement by pressing [prgm] arrowing to I/O, and selecting ClrHome.
Add a Prompt statement by pressing [prgm], arrowing over to I/O, and selecting Prompt.
Add the variable R by selecting [ALPHA] [X].
Add the variables G and B for the Green and Blue values, respectively. Be sure to add a comma between variables. Press enter.
Now we'll use the Send( command to send an instruction to the TI-Innovator™ Hub.
Press [prgm] and arrow over to the HUB menu.
Select Send("SET… and then select COLOR.
You cannot send the variables R, G, and B as the color values in the Send( statement because the letters R, G and B would be sent to the TI-Innovator Hub rather than the values of the variables.
We need to use a special function, eval( ), from the HUB menu which is designed to convert the value of an expression in the calculator into a string representation that the TI-Innovator™ Hub can process.
Add the eval( function by pressing [prgm], arrowing over to the HUB menu, and selecting eval(.
Type the letter R and the right parenthesis.
Repeat the eval() function two more times for G and B. Don't forget to add a space in between.
Finally, after the third eval() function, add the closing double quotation mark for the string and the right parenthesis for the Send( command.
Make sure the TI-Innovator™ Hub is connected to the calculator.
Press [ALPHA] [GRAPH], which is the F5* key.
This sequence of steps quits the Program Editor and runs the program on the home screen.
You will get three prompts on a cleared home screen, one for R, one for G, and one for B.
Enter numbers between 0 and 255, inclusive, for each variable, pressing enter each time.
After entering the third value, notice the color of the COLOR LED on the TI-Innovator™ Hub.
To try a different set of values, press [enter] to rerun the program, and enter three new values.
In this third lesson for Unit 1, you will learn another method to get user input into a program and how to control the SOUND on the TI-Innovator™ Hub.
The TI-Innovator™ Hub has a built-in speaker called SOUND.
You control the sound coming out of Sound by sending a frequency value. Sound frequencies are measured in Hertz (Hz), or 'cycles per second'.
The Input statement, like Prompt, is found in the [PRGM] I/O menu. It is also used to get input from the user, but it contains a feature that lets the programmer create a more meaningful message rather than the simple Prompt studied earlier.
In this sound program, we'll use the Input statement.
Start a new program, and name it SOUND1.
Add the ClrHome and Input statements from the [PRGM] I/O menu.
After the Input command, use [A-LOCK] ([2nd][ALPHA]) to type the string of characters "FREQUENCY?".
Turn off the alpha lock to type the comma.
Then add the variable that will represent the frequency, F ([ALPHA] [COS]).
Add another Input statement to let the user enter the time for which the sound should play.
As with the COLOR program in the previous skill builder, you need to use the eval( ) function to evaluate the variables F and T.
Press [PRGM], arrow over to the HUB menu, and select Send("SET….
Press [PRGM], arrow over to the HUB menu, and select eval(.
Add the variable F, and close the parentheses.
Type a space ([ALPHA]) and then add another eval( function for the variable T.
Add the variable T, and close the parentheses.
Add the closing quotation mark and the parentheses for the Send( command.
Press [ALPHA] [GRAPH]  (Execute Program).
Enter the frequency 440 and the time 5.
This will play the tone 440Hz for 5 seconds. This means that the speaker vibrates 440 times a second for 5 seconds.
In a noisy environment, you might have to hold the TI-Innovator™ Hub close to your ear to hear the tone.
Press [ENTER] to rerun the program with another frequency and time.
Write a program that controls a traffic light.
Your task is to write a program that controls a traffic light. The light will be simulated using the COLOR LED on the TI-Innovator™ Hub.
The COLOR LED should switch from green to yellow to red AND from red to green. Timing is up to you.
Your program will have a sequence of statements that simulate the change from RED to GREEN to YELLOW to RED. A sequence control structure in programming is a set of statements that are processed one after another, from top to bottom, without interruption.
The Disp command displays a message on the HOME screen of the calculator. It can be used to display the value of a variable as in Disp X, or it can display a string like in the example on the right. You can find Disp by pressing [PRGM] and arrowing over to I/O and selecting Disp.
The Pause command displays a message as well but stops the calculator from processing any more statements until the user presses [ENTER]. You can find Pause by pressing [PRGM] and selecting Pause.
Begin a new program, and call it APPLIC1.
Add a ClrHome statement from [PRGM] I/O menu.
Add Disp by pressing [PRGM], arrowing over to I/O, and selecting Disp.
In quotation marks ([ALPHA] [+]), add the message "TRAFFIC LIGHT".
In quotation marks, add the text "PRESS ENTER..." as shown.
First we set the color to red by setting the RGB values of 255, 0, 0.
In the example on the right, we use a Wait statement to tell the calculator to wait 5 seconds before sending the next command to the TI-Innovator™ Hub. The red light will stay on during this time.
Your task is to add the statements to make the light green, then yellow, then red again.
Challenge: Add SOUNDs to indicate the color of the light.
In this first lesson for Unit 2, you will learn about the For loop in the calculator through a program that makes the LED LIGHT blink while displaying information on the calculator screen.
Let's write a program to make the LED LIGHT blink a certain number of times. With other input statements, you can also control the amount of time that the light is on and off.
This program introduces you to the For…End loop.
Start a new program, and name it LIGHT2.
Add ClrHome by pressing [PRGM], arrowing over to I/O, and selecting ClrHome.
Within quotation marks, add BLINK as shown.
Add Input by pressing [PRGM], arrowing over to I/O, and selecting Input.
Within quotation marks, add NUMBER OF TIMES? as shown.
Next add a comma and the variable N.
Add the For( statement by pressing [PRGM] and selecting For(.
Add the rest of the statement's arguments, I,1,N).
This statement means "For I going from 1 to N by ones".
Press [ENTER] a few times to create blank lines that we'll fill in later, and then add the End statement to the program by pressing [PRGM] End.
Don't worry about how many blank lines to enter. You can always add more lines if you need them, and blank lines have no effect when you run the program.
The block of statements between For and End is called the 'loop body'. It is this section of code that will be processed N times thanks to the work done by the For loop.
Note: To insert a blank line into a program, open the F5 menu ([ALPHA] [GRAPH]), and use Insert Line Above.
We want the light to blink ON and OFF N times. We also want the calculator to display the number of the blink.
Start the loop body with Disp I which will display the loop control variable.
Now add statements to turn the light ON and OFF as shown.
Add Send("SET LIGHT from the [prgm] HUB menu.
Add the word ON from the [prgm] HUB > SETTINGS submenu.
Remember to add the closing quotation mark and right parenthesis, and press [ENTER].
Add Wait (in seconds) from the [prgm] HUB menu so that the calculator waits before sending the next command.
In our program, we use 1 second but you can use any values you like, including decimals.
Copy the Send( command using [ALPHA] [GRAPH]  and [ALPHA] [GRAPH]  (Copy Line and Paste Line). Edit the statement to change ON to OFF.
Copy the Wait statement using the same method.
Run the program by pressing F5 ([ALPHA] [GRAPH]) and then [ENTER]. You should see the light blink and the counter increase on the home screen.
Here's a challenge: Add Input statements at the top of the program (before the For( statement) to set the timing for each of the two Wait values (the ON time and the OFF time). Use those variables instead of numbers in the Wait statements.
Run the program again. Observe the blinking and the values displayed on the calculator screen.
In this second lesson for Unit 2, you will learn about controlling the intensity of the three colors of the COLOR LED on the TI-Innovator™ Hub.
The red, green, and blue values (from 0 to 255) sent to the COLOR LED determine the brightness of each color channel. This program demonstrates varying the amount of each color gradually to transition through some of the over 16 million (256³) colors possible. You will again use some For loops in your program.
Start a new program and call it COLOR2.
Add ClrHome and add Disp with the title the program as shown.
Add Input and in quotations marks add WAIT?.
Then add a comma and the variable W.
This variable will be used in a Wait statement. The lower the number, the lower the wait time, and the faster the program executes the next command.
As shown on the right, also input a STEP value to be used in the For loop to control the speed of the color change.
Our program will gradually (depending on the wait and step values) increase the RED intensity, then add GREEN, then gradually take away the RED, then add BLUE, take away GREEN, then add RED to the BLUE, then take away the BLUE, then finally take away the RED. This is a rather long program, and you can run it after you complete each of the For loops to test the code.
It's a good practice when working on more complicated programs to insert both the For( statement and its corresponding End statement at the same time so that you don't forget it later on. Just leave some blank lines in the loop body by pressing enter a few times.
Add the rest of the components of the For( statement to make the value of I go from 0 to 255. Use the loop variable I and the step variable S.
Add the Send("SET COLOR statement from the [prgm] HUB menu.
Use the eval( function from the [prgm] HUB menu for the variable I to control the red channel, and set the GREEN and BLUE channels to 0.
Remember to close the quotes and the parentheses.
Follow the Send statement with the Wait statement using the variable W that you used in the Input statement earlier.
After the End of this first For loop, you can use the Pause statement with a message in order to admire that bright red LED.
This second statement controls only the GREEN channel and does not affect the RED and BLUE channels. In both cases, notice that we can reuse the variable I from the first For loop.
In the image to the right, note that we chose to use Send("SET COLOR.GREEN eval(I)").
Add the Wait statement inside the loop body using the variable W.
Add the Pause statement after the End of the loop again to admire the new color. What color is that?
Now we want to gradually decrease the amount of RED so that we are left with only GREEN.
starts at 255 and subtracts S in each step of the loop until the variable I is less than 0 when the loop ends. Be sure to use the [(-)] 'negative' key and not the subtraction key. That would cause an error.
We only want to change the RED channel, so we'll use COLOR.RED in the Send statement.
The rest of this loop is similar to the first two loops we constructed. The image to the right shows only the keywords entered.
Can you complete each of these statements? If not, refer to the next step.
The image to the right shows the completed section that removes the RED gradually. At the end of this loop, you should see a bright GREEN color.
Now add a loop to add BLUE.
Next add a loop to remove GREEN.
Then add a loop to add RED again.
What color do you see at the end of these loops?
Then add a loop to remove BLUE.
Finally, add a loop to remove RED.
What color is the LED at the end of the program?
What happens when all three color channels are 0?
In this third lesson for Unit 2, you will learn about the relationship between the frequencies of the musical scale and write a program to play notes that musicians have used for many centuries.
Musical notes are determined by the frequency of a vibrating object such as a speaker, drum head, or string as in a guitar or piano. The notes of the musical scale have a special mathematical relationship. There are 12 steps in an octave. If a note has frequency F, then the very next note has frequency F × 12√2.
Multiplying a note's frequency by 12√2 or 21/12 (the twelfth root of 2) twelve times results in a doubling of the original frequency, so the last note in the octave (or the first note in the next octave) has frequency of F ×(21/12)12 = 2 × F. For example, if a note has a frequency of 440 Hz, the note an octave above it is 880 Hz, and the note an octave below is 220 Hz.
The human ear tends to hear both notes an octave apart as being essentially "the same", due to closely related harmonics. For this reason, notes an octave apart are given the same name in the Western system of music notation—the name of a note an octave above C is also C. The intervals between these notes are called 'semitones'.
In this project, we'll take advantage of the 21/12 principle to generate the 12 notes in an octave.
Middle C has a frequency of 261.64Hz. An octave above Middle C, also known as Treble C, has a frequency 2 × 261.64Hz or 523.28Hz. There are 12 steps (semitones) between these two notes, and each step is 21/12 times the note before it.
In the image to the right, we entered 261.64 on the HOME screen. Then, in the next statement, the value is just multiplied by 21/12.
The calculator supplied Ans at the beginning because the multiplication symbol requires something in front of it. Just pressing [ENTER] repeatedly creates the sequence of answers shown.
We will incorporate this repetitive principle into our program. If you continue the progression, the twelfth answer will be 523.28, two times the starting value, because F × (21/12)12 = 2 × F.
Start a new program and name it SOUND2.
Add the commands ClrHome and Disp , and type the message within quotation marks as shown.
Assign the starting frequency, 261.64 to the variable F using the [STO →] key.
This variable will represent each of the 12 notes in the scale.
Add a For( loop that goes from 1 to 12 (for the twelve notes).
Add Send( "SET SOUND statement from the HUB menu.
Add eval( for the variable F as shown. Be careful with the quotation symbols and parentheses!
This statement takes the current value of F and changes it to the next higher note's frequency on the scale.
Run the program. Did you hear anything? Is it what you expected?
Try adding the TIME parameter to the SEND( " SET SOUND command, and be sure to add an equivalent Wait statement to the program to let each note finish playing.
If a new command is received by the TI-Innovator™ Hub before it finishes its last task, then the device will process the new command instead of finishing the current one. Syncing the calculator with the TI-Innovator™ Hub is up to the programmer.
When you run this program you will not hear the usual 'do-re-mi-fa-sol-la-ti-do' sequence. That's only eight notes. The others correspond to the black keys on a piano. How can you get the program to only play the correct eight notes?
You will use the random number generator on the TI-84 Plus CE to create some computer-generated 'music'.
Your task is to complete a program that asks for the number of notes to play, and then uses a For loop to play the given number of random notes. As the note is being played, the frequency should be displayed on the calculator screen using Disp.
In this application, we will use the randInt( ) function of the TI-84 Plus CE to generate a random note on the musical scale.
From the HOME screen, locate randInt( on the math > PROB menu.
This command takes two (or three) arguments. Initially, you will get a 'Wizard'.
Enter a lower and upper value and leave n: empty.
n is used to create a list of n numbers.
Select Paste to put the command on the HOME screen and press enter.
From then on, just up-arrow to the previous command, press enter to reuse it, and edit the two arguments to see the output of the function.
As you can see on the chart, the frequency of the note A in the first octave is 55Hz. The range 0 to 59 in the randInt function represents the 60 notes in the chart. Notice the use of N in 2^(N/12) to generate the Nth note from A in the first octave. When N is zero, then the frequency is 55Hz, since 2^0 is 1.
Use a Wait command to keep the calculator in sync with the music.
In this first lesson of Unit 3, we investigate the onboard light sensor, BRIGHTNESS, and introduce the Output( statement in TI-Basic to illustrate a technique for efficiently displaying a number of different lengths using Output(.
In the previous lessons, we have only been sending instructions to the TI-Innovator™ Hub to have an impact on its built-in devices (LIGHT, COLOR, and SOUND).
In this unit, we will work with the onboard light sensor and use the value in our program to create a 'light meter'. The light sensor produces values in the range (0 to 100) in decimal form.
Start a new program, and name it BRIGHT1.
Add the commands ClrHome and Disp to display the title as shown to the right.
Select Send("READ… and then select BRIGHTNESS.
Press [prgm], and arrow over to the HUB menu.
Select Get(. Enter the variable B, and the right parenthesis.
READ BRIGHTNESS tells the TI-Innovator™ Hub to read the brightness level and store that value in an onboard 'buffer'.
Get(B) is a calculator command to get a value from TI-Innovator™ Hub. This statement transfers the value in the buffer on the TI-Innovator™ Hub into the variable B in the TI-84 Plus CE. B can be replaced by any of the calculator's numeric variables, A..Z and Ɵ (theta).
The While…End loop ([prgm] CTL menu) is used to process a block of code while a condition is true. A condition is a logical statement that can be evaluated as true or false. The relational operators and the logical operators are found on the test menu of the calculator ([2nd] [math]).
The relational operators are =, ≠, <,>, ≤, and ≥.
The logical operators are and, or, not, and xor.
These operators can be used together to build compound conditions such as x>0 and y>0.
We are going to use a simple While loop that stops when the brightness value is less than 1. To terminate the program, simply cover the light sensor on the end of the TI-Innovator™ Hub with your hand.
Another way of 'breaking' or terminating a running program is to press the ON key. You will see the error message: ERROR: BREAK at the top of the screen and have the option of 1:Quitting to the HOME screen or 2:Goto the program editor at the point where the action of pressing ON stopped the program. This is also a convenient way to continue editing the program.
The statement 2→B initializes the loop. As long as the condition B>1 is true, the loop continues reading the light sensor. Once it becomes false, such as when there is no more light coming into the sensor, the loop and the program terminate.
Add the Output( statement after the Get( statement and before the End of the loop, as shown, by pressing [prgm], arrowing over to I/O, and selecting Output(.
The Output( statement gives you great control over where on the HOME screen something should be displayed. The structure of the statement is: Output(<line#>, <column#>, <string or variable>).
Output(3,7,"HELLO") will place the letter "H" at line 3, column 7 of the HOME screen and the rest of the word will follow the letter "H".
Output(5,10,B) will place the first digit of the value of the variable B starting at line 5, column 10 of the HOME screen and the rest of the digits follow.
Run the program with the TI-Innovator™ Hub attached.
You should see the title message at the top of the screen and a value in the middle of the screen that changes depending on the light intensity being read by the sensor. Note that the value shown is not a standardized value.
To end the program, cover the light sensor on the end of the TI-Innovator™ Hub so that the brightness value displayed is less than 1.
The Output( statement does not erase trailing digits when a shorter number is displayed after a longer number. For example, if one value displayed is 1.23456 and the next value displayed is 55, then you will see 5523456. Our final modification to this program is a tricky way of correcting this problem.
To correct the 'trailing digits' issue, we convert the variable B into a string and add some spaces to the end of it to completely erase the previous value displayed.
toString( is found on the [prgm] I/O menu.
There are about 10 spaces between the quotes above.
Now, when you run the program, you will see that some values are shorter than others because the spaces that we added to the string representation of B erase the previous digits.
The "+" sign used in the Output( statement is not used for addition: it is used to 'concatenate' (combine) two strings (sets of characters). The spaces (in quotation marks) are appended to the end of the string representation of the variable B.
In this second lesson of Unit 3, we'll develop an automatic light switch that responds to ambient light, turning on when darkness falls and turning off when the amount of light increases.
Now write a program that detects the BRIGHTNESS value and turns a light on when it gets 'dark'. When the room lighting gets brighter, the light goes off. This is exactly how many automatic light switches and night lights work.
Our program will read the light sensor on the TI-Innovator™ Hub and turn the onboard LIGHT ON whenever the brightness value falls below a certain level and turn it off when the brightness is above that level.
Use your brightness meter from the previous lesson to determine a suitable 'middle value' between 'lightness' and 'dark'.
Start a new program, and name it BRIGHT2.
Add the commands ClrHome and Disp and an informational title after Disp, as shown to the right.
Initialize the variable B by adding the statement 2→B.
Add End to close the while loop.
To terminate the loop and the program, cover the light sensor.
In the While loop body, add Send("READ BRIGHTNESS") and Get(B) from the [prgm] HUB menu as shown.
If statement will have two 'blocks' of code: one for when the condition is true and another for when the condition is false.
You can add more blank lines by pressing [ins] [enter] or by using F5 ([ALPHA] [GRAPH]) menu option Insert Line Above.
The brightness value is stored in the variable B and ranges from 0 to 100.
What is a good 'dark' value? We chose 25, but you can change it to any value between 0 and 100. Use your brightness meter from the previous lesson to decide on a lightness-darkness boundary value.
You could improve the program by using an Input statement for the 'trigger' value. Just be sure to use the Input statement before the While loop starts.
Get the '<' (less than) operator from the [test] menu ([2nd] [math]).
Turn the LIGHT ON or LIGHT OFF in the Then and Else blocks as shown.
Control the light hitting the sensor, and watch the LIGHT (the red LED on the Hub) turn on or off.
One final note: The light will be ON when the program ends. Why? Add a statement to make sure that the light is off.
In this third lesson of Unit 3, we'll make use of the BRIGHTNESS value to control the COLOR LED.
We will build a product that reacts to the brightness in the room. The brighter the room lighting, the brighter the COLOR LED. The tricky part here is converting the BRIGHTNESS value into an appropriate COLOR value. Think of this product as an auto changing (dimming or brightening) light bulb.
BRIGHTNESS B ranges from 0 to 100.
COLOR C (all three channels) can vary from 0 to 255.
How do we convert from B to C?
Start a new program, and name it BRIGHT3.
Set the variable B as shown.
Add a While loop to read the brightness using Send("READ BRIGHTNESS") and get the brightness variable with Get(B).
Use the variable C to represent the COLOR value that we'll send to all three channels of the COLOR LED. The conversion factor is 2.55. That is, 2.55*B→C.
Check this formula with the two pairs of values given.
When B=0 then C=2.55*0 ==> 0; when B=100 then C=2.55*100 ==> 255.
Add a Send("SET COLOR statement before the End of the loop. This statement will control the brightness of the color LED.
Finally, complete the SET COLOR command by using eval(C) three times (once for each of the three color channels).
When all three channels have the same value, then the color of the LED is white and the brightness of the LED changes depending on that value.
Connect the TI-Innovator™ Hub, and run the program.
Change the brightness by pointing the light sensor at different things. Watch the intensity of the COLOR LED on the TI-Innovator™ Hub.
To end the while loop and hence the program, cover the sensor completely so that the value of B goes below 1.
You might want to add some Output( statements to your program to see the values of B and C.
But wait! The effect is wrong! The darker the room lighting, the brighter the LED should be! How can you reverse the effect?
Another Challenge: How about changing the program so that different brightness values produce different colors?
In this application, you will write a program to control the sound coming from the speaker based on changing the brightness sensed by a light sensor – hence, Lite Music!
Play a musical note (one of the specific harmonious sounds found on a piano or other musical instrument).
The first option would just play what sounds like 'noise'. The second option will sound more like music, but the mathematics is a bit more complex.
This program makes the TI-Innovator™ Hub behave like a theremin. You can vary the amount of light visible to the BRIGHTNESS sensor by adding light (using a flashlight) or removing light (partially covering the sensor).
Start a new program, and name it APPLIC3.
Add a While loop to Read the BRIGHTNESS sensor and Get its value into a variable B.
Add the statement to play a sound.
Notice that we're using the variable B for reading BRIGHTNESS and the variable F for playing the SOUND.
Your task is to complete the missing code that converts the BRIGHTNESS into an audible sound or a musical note.
For sound, use a frequency between 100 and 1000 Hz (or two frequencies of your choice).
For the musical notes, you will need to convert your value to a whole number so that a note 'number' is correctly represented. You can use either the int( ) function or the round( ,0) function.
gives the largest integer less than X.
Unit 4: Make Rover Move!
In this first lesson of Unit 4, you will learn about working in the Program Editor to write a program that makes the TI-Innovator™ Rover move.
When writing a new program or editing an existing program, TI-Innovator™ Rover commands are found when you select [prgm], then the Hub menu, and then 7:Rover (RV)….
To quickly reach the Rover commands, select [prgm], then select the left arrow to move to the Hub menu, and then select the number 7.
Some portions of the final instruction, such as numeric values and optional parameters, are entered as normal keypad characters or selected from another Rover menu.
Some Rover commands include the closing quotation mark and parenthesis and others do not, indicating that there's (possibly) more to enter within the command. In either case, all commands need to be ended with the closing quotation mark and closing parenthesis.
RV is the name of the Rover device.
First, select the [prgm] key, and then select the HUB menu.
Then, select the Rover (RV)… submenu.
Finally, select Send("CONNECT RV"). The command is located near the bottom of the submenu.
Next we will add a Pause statement. This command pauses the calculator program and waits for the user to press the enter key.
Press [enter] to move to a new line in the program.
Press the [prgm] key and, in the CTL menu, select Pause.
Add an appropriate message after the Pause command such as "PRESS ENTER TO START" using the Alpha keys.
When running the program, if you hear a beep from the TI-Innovator™ Hub before (or while) you see "PRESS ENTER TO START" it means that the CONNECT RV command was unsuccessful. Make sure the Rover is turned on.
Press [enter] at the end of the Pause statement in order to add the next command which will cause the Rover to move forward.
Press prgm > Hub > Rover (RV)…, and then select the Drive RV… menu as shown to the right.
Select FORWARD from the Drive RV… menu.
Notice that the command that is pasted into the program is missing the closing quotation mark and the closing parenthesis. We still need to add some information.
Add the number 1, and then add the closing quotation mark and a closing parenthesis to the command. The quotation mark is [alpha] [+] and the closing parenthesis key is above the 9 key.
Quit the editor ([2nd] [mode]), and run the program. Be sure that there is about one foot of free space in front of the Rover.
If all is well, then the Rover should move forward. But how far? Study the movement carefully and determine what FORWARD 1 means.
The calculator displays 'Done' when the program ends. Notice that the program actually ends before the Rover finishes moving. The calculator and the TI-Innovator™ Hub work at different rates.
Edit the program, and add the statement Send("RV BACKWARD 1") by pressing prgm > Hub > Rover (RV)… > Drive RV… > BACKWARD.
Then add the number 1 and the closing quotation mark and closing parenthesis as you did in the FORWARD statement.
Quit the editor, and run the program again. This time, the Rover should move forward a bit and then back to its original position. If it does, congratulations! You made the Rover move.
The next two commands in the Drive RV… menu are LEFT and RIGHT. Add these two commands to your program, and run the program again. What do these instructions do?
Study the program to the right, and predict what the Rover will do and where it will end up when the program ends. Enter the commands into your calculator, and run the program.
Did your program do what you expected? Can you make a program with only these commands that causes the Rover to make a rectangular pattern?
Access the new supplemental Program Editor menu by pressing alpha-F5. Use this menu to copy a line (5: Copy Line) and paste the line (6: Paste Line Below) below the current cursor line. You can also undo and insert lines and run the program from this menu.
In this lesson, you will investigate some of the optional driving features. The four driving commands in Skill Builder 1 did not include the closing quotation mark and closing parenthesis. This is because there are other options that you can supply to the commands. This lesson investigates those options.
They are found in the prgm > Hub > Rover (RV)… > RV Settings… menu. Also, SPEED rates (UNITS/S and M/S) can also be accessed in this menu.
FORWARD DISTANCE # is the same as FORWARD #.
FORWARD DISTANCE # M moves the Rover # Meters.
FORWARD # SPEED # where speed is between 1.4 and 2.3.
Values outside this range result in a TI-Innovator™ Hub error.
You can specify any two of these three options in the FORWARD and BACKWARD commands.
You can also use eval( ) if the value you want to use is stored in a calculator variable or if you want to use the result of an expression.
These commands by default turn the Rover RIGHT or LEFT 90 degrees but you can add a degree measure to the command to turn any angle (-360…360 degrees). Negative values are also permitted, so LEFT -90 is the same as RIGHT 90.
Add a command to make the Rover turn RIGHT 135 degrees. You have to key in the 135 plus the closing quotation mark and closing parenthesis. The word DEGREES is not needed but is available in the RV Settings… menu for clarity.
You could also specify the angle measurement in RADIANS or GRADS but these units must be stated and are also found in the RV Settings… menu.
Some examples are shown to the right. What is the final heading of the Rover after these three statements are processed?
Write a program to make the Rover drive along the path of an equilateral triangle.
In this third lesson of Unit 4, you will learn about turning to a specific angle heading, timing, and working with the COLOR LED on the Rover.
The command Send("RV TO ANGLE <number>") is used to turn the Rover to a particular 'heading'. When you send a command to connect the Rover, its heading is set to 0 degrees, which, in the mathematical world, is 'East' (facing from the origin toward the positive x-axis). In this world, North is 90 degrees, West is 180 degrees, and South is 270 degrees. See the diagram to the right.
Regardless of where the Rover is currently heading, the command Send("RV TO ANGLE 0") causes the Rover to turn to the direction that it was heading when the "CONNECT RV" command was issued.
The default angle measure is DEGREES but you can also specify RADIANS or GRADS (selected from the RV Settings… menu).
Did the Rover do what you expected?
Programs on the calculator are 'Done' before the Rover finishes moving. This is because the driving commands are stored in the TI-Innovator™ Hub faster than the Rover can process them. Driving commands are stored in a 'queue' and are processed by the TI-Innovator™ Hub when the Rover is ready for them.
In this activity, we'll write a program to move in a random pattern and light up the RV.COLOR LED on the Rover while the Rover is moving. We'll also make use of the TO ANGLE command and incorporate eval( ) to turn to the appropriate heading.
Add a For loop to have the Rover move in a random pattern. Remember that it's a good idea to put the End of the For loop in the code now so that you don't forget it later on. You can always add lines to the loop body if you need them. Note: The For( and End commands are in the CTL menu.
In the loop body, add the statement to move FORWARD.
Add the TO ANGLE statement to turn in the direction H.
The Rover moves in a random pattern.
The program is 'Done' almost immediately while the Rover still has to move.
Since the color LED on the TI-Innovator™ Hub is hidden inside the Rover, we are given another color LED on top of the Rover to control. The name of the Rover's color LED is RV.COLOR and works using the same controls as the onboard LED. You can use any of the four commands in the prgm > Hub > Rover (RV)… > RV Color… menu shown to the right.
Send("SET RV.COLOR 255 255 255") produces a white light.
Add a RV.COLOR command to the loop body immediately before the FORWARD 1 command. The color values are up to you.
Run the program again to see what happens. Notice that the LED lights up almost immediately and stays on.
Now, let's try to get the LED to light up only while the Rover is moving FORWARD. This will require that we make the calculator Wait until each segment is completed and then turn the LED off while it is turning.
We need to add a Wait statement to our program to control when the LED is turned on and off.
How long does it take the Rover to move FORWARD 1? About 1 second? Add a Wait 1 statement after the FORWARD 1 statement. Recall that Wait is found in the prgm > Hub menu.
Note that the LED still stays on. We have to turn the LED off after the Rover has finished moving.
How long does it take the Rover to turn? About 1 second? Add a Wait 1 statement.
After the Wait 1 statement, turn the LED off by adding Send("SET RV.COLOR 0 0 0").
Test your program. Did the Rover turn the light off at the right time?
We also need to wait while the Rover turns to a new heading to make sure the light has turned off.
Add a Wait statement after the TO ANGLE statement. This Wait should be long enough to handle any turn from 0 to 360 degrees.
Can you make a different color at each corner? Hint: Use eval(something).
Additional Challenge: Make the turning wait time a function of the angle to be turned by observing the Rover's turning direction when using TO ANGLE.
The application for this unit is to program the Rover to make a polygon where the user enters the length of a side (in 'Rover units') and the number of sides of the polygon. The Rover will then make the polygon.
Recall that the purpose of eval( ) is to convert the value of a calculator variable or expression into a string to be sent to the TI-Innovator™ Hub. In the sound program shown at the right, the user enters a frequency for the variable F. The eval(F) function converts that number into a string representation that the TI-Innovator™ Hub can process.
Write a program that asks for the length of a side and the number of sides of a polygon and moves the Rover in that pattern. You can add a marker to the Rover and actually draw the polygon on a large sheet of paper. Remember that 1 unit is 10 cm.
Optional: Make the COLOR LED light up at the vertices of the polygon.
In this first lesson for Unit 5, you will learn about the TI-Innovator™ Rover's Ultrasonic Ranger sensor and its ability to control the Rover's motion.
At the front of the TI-Innovator™ Rover is a sensor called the Ultrasonic Ranger. The Ranger measures the distance to an object in front of the Rover. This information can be used to control the Rover's movement; if the Rover gets too close to an obstacle, it can be programmed to change direction to avoid the obstacle.
We'll first write a test program to determine how the Ranger works and then, in Skill Builder 2, we'll use that information to control the Rover's movement.
The program will read the Rover's Ranger value and display that value on the calculator screen. The Rover will not move in this program. You will move your hand in front of the Rover or hold the Rover in your hands, and point it toward various obstacles to observe the measurements.
Our new program is named ROVER61. It begins with the ClrHome command. Next, add the Send ("CONNECT RV") command from the prgm > Hub > Rover (RV)… menu.
We'll use a While loop to control the program. When the distance measured is less than a certain value, the program will end. We use the variable D to record the distance measured.
Initialize D to be 1.
Select While from the prgm > CTL menu. Code the While loop to continue as long as D is greater than 0.1.
prgm > Hub > Rover (RV)… > Read RV Sensors… menu.
Getting a value from a sensor requires both the Send("READ…") command to get a value from the sensor into the TI-Innovator™ Hub and the Get( ) command to get the value from TI-Innovator™ Hub to the calculator. The Wait .25 command is used to slow the operation down to make the numbers easier to read and understand.
We use an Output( ) command to display the value of D in a fixed position on the calculator screen.
While the program is running, the calculator screen displays a number. Move your hand in front of the Rover so that the Ranger can measure various distances. In what units are these distances measured? When will the program terminate?
Answer: The units are meters, and the program will end when the distance measured is less than 0.1 m, or 10 cm.
In the first lesson of Unit 5, you tested the Rover's Ranger to see how to read the sensor and display a value. This lesson advances that testing to control the Rover's motion.
Let's write a program to make the Rover move back and forth between two 'walls'. We'll start the Rover moving FORWARD, read the Ranger sensor and, when the Rover gets too close to the wall, make the Rover stop, turn around, and move FORWARD.
Begin the program in the usual manner.
Add a For( loop that will iterate ten times.
Add a FORWARD 100 command to move ahead 10 meters (100 * 0.1m per unit).
Remember to End the For( loop structure.
As in the previous lesson, we'll use the variable D to represent distance from the Ranger to an obstacle.
Initialize D to 1, and start a While D > 0.25 loop.
Note the two Ends in the code; one is the End of the For loop and one is the End of the While loop.
We next insert the code in the body of the While loop. If you don't have enough blank lines in your program, place the cursor at the beginning of a line where code is to be inserted. Press [ins] ([2nd] [del]), and then press [enter]. Alternatively, to add a line of code above a current line of code, press [alpha] F5, and select Insert Line Above.
Add the Send("READ RV.RANGER") command.
Use the Get( command to store the value into the variable D.
That completes the While loop. The Rover is moving FORWARD 10 meters, and the While loop is monitoring the distance. If desired, add an Output( statement to this While loop to display the current distance to make sure things are working properly.
When the While loop ends, this indicates that the Rover is too close to an obstacle. We'll tell the Rover to STOP moving FORWARD and turn around. However, we do not need to tell the Rover to move FORWARD again.
After the End of the While loop but before the End of the For loop, add the RV STOP command and then the RV RIGHT 180 command.
Quit, and test your program. When the Rover gets close to an obstacle, it should turn around and go in the opposite direction. Adjust values (minimum distance and Wait time), as needed, for your surface situation. If the Rover gets too close to the wall, then the back of the Rover could bump the wall when turning around.
In this third lesson of Unit 5, we introduce the COLORINPUT sensor and use its value to cause the Rover to change direction.
We'll use a For loop to cause the Rover to move and turn four times.
End is the end of the For loop structure.
We will use a While loop to look for a change in color but first we need to know what color the Rover currently 'sees'. We READ RV.COLORINPUT, and Get its value into the variable C in the calculator.
We then initialize another variable, D, to get the While loop started. D will hold the color the Rover sees while it is moving. Initially, we set D to be the same as C. Then, we start the Rover moving FORWARD.
We now code the While loop to compare D with C because, inside the While loop, we'll look for a change in the value of D.
The 'equals' sign is located in the [test] menu ([2nd] [math]).
Don't forget to add an End statement for the While loop (not shown).
Inside the While loop, we monitor the color sensor as long as the Rover is moving. We store the color value in variable D. The loop ends when D (the 'current' color) is different from C (the 'original' color).
At the end of the While loop, we tell the Rover to STOP and go RIGHT. Notice that these two statements fall between the two Ends of the program. The second End is the end of the For loop, so the program causes the Rover to turn right four times when it detects a change in the color of the surface.
Add a FORWARD 1 command and a Wait 1 statement so that the Rover moves away from the colored spot before the program loops back to detect the new 'original' color (C) again.
Test your program on the floor on a surface of uniform color (white). Place an approximately 5 cm by 5 cm contrasting color (black) spot on the floor in the Rover's path so that the COLORINPUT sensor will see it. When the Rover passes over the spot, it should stop, and then turn and go again. Pick up the color spot, and place it in front or the Rover again. This will have to happen four times for the program to complete.
In this application for Unit 5, you will write a program to get the Rover to follow a path on a piece of paper.
The Rover will start at the left edge of the page and travel to the right following the curved path across the paper. When the Rover sees RED, it will turn to the left a little and move forward a little. When the Rover sees WHITE, it will turn to the right a little and move forward a little.
Experiment with the turning angle and the moving distance to see how the Rover reacts to the different colors. If your page is red and white as in the image above, you can use READ COLORINPUT.RED to see what values are given by each side of the paper. If you use a different color such as black, you can use READ COLORINPUT.GRAY (or .GREEN or .BLUE).
Notice that the Rover does not move in this program. Use the above program to determine what the Rover sees on each side of the wavy line by observing the values of R that are displayed. Use this information to design your program. Test your program by placing the Rover on the left edge of the paper with the color sensor near the border between the red and white sides of the paper. Be sure the Rover's color sensor is over the paper. Your program should work no matter where the Rover begins.
This program uses an infinite loop. To 'break' or terminate a running program is to press the ON key. You will see the error message: ERROR: BREAK at the top of the screen and have the option of 1:Quitting to the HOME screen or 2:Goto the program editor at the point where the action of pressing ON stopped the program.
In this first lesson for Unit 6, you will learn about the TI-Innovator Rover's coordinate system and movement to coordinates.
The Rover has a 'built-in' coordinate system just like a graphing system. When you Send "CONNECT RV", the Rover's position on the coordinate grid is set to (0,0) and its heading is 0 degrees (points toward the positive x-axis).
FORWARD moves the Rover to the right.
LEFT turns the Rover 90 degrees counterclockwise.
Our program will tell the Rover to move to a point on its coordinate grid. We'll use one Prompt statement to enter values for X and Y and then make the Rover drive to the point (X, Y) and then move back to the origin.
Start your program with the ClrHome (prgm > I/O > ClrHome) command as well as the usual instructions.
Include a Prompt statements for X and Y.
Recall that Prompt will display the name of the variable and a question mark. More than one variable can be requested in a Prompt statement.
The Pause statement gives you time to place the Rover at the origin and face the Rover in the 'right' direction.
The command will appear in your program as an incomplete statement.
The x- and y-coordinates must be added and will be stored in the variables X and Y, respectively. In order for the TI-Innovator™ Hub to use these values, you must use the eval( ) function twice.
Add eval(X) eval(Y) to the command, and then add the closing quotation mark and closing parenthesis.
Test your program now. Depending on the coordinate values you enter, the Rover will move to that position.
Add a Wait command to let the Rover move to your point, and then tell the Rover to return to the origin. Simply use the numbers 0 and 0 separated by a space. Also, add a statement to make the Rover point in its original direction (TO ANGLE 0).
Test your program again. This time, the Rover should travel to your entered point and then return to the origin and face in the original direction.
In this lesson, you will use the TI-Innovator Rover to mark two points on its coordinate plane and determine the distance between the points using the distance formula.
This activity requires that a marker be used in the Rover's marker holder to leave a trail on the paper.
We'll write a program that marks two points on the plane and computes the distance between the two points. You will then measure the distance between the two points and compare the measurement with the calculation.
Start your program with CONNECT RV and include the Rover command to set the unit distance to one inch (1 inch ≈ 0.0254 meters). The RV.GRID.M/UNIT command is found in the Rover (RV) > RV Setup menu.
Include four Input statements for the coordinates of the two points. Keep in mind that variables on the TI-84 Plus CE are single letters only.
Note that we use the variables X, Y, Z, and W for the coordinates.
Next, we get the Rover to move to the first point, Wait while the Rover moves, and then make a SOUND and LED color to indicate that the Rover has reached its point. We will also use a Pause statement here and turn the LED off after pressing enter. Recall that the sound will play for only one second by default.
Next, we get the Rover to move to the second point. A different sound and different LED color is used to indicate that the Rover has reached the point. A Wait statement is used here to keep the LED on for a few seconds before turning it off.
Be careful with the parentheses.
In this lesson, you will write a program to make a pre-designed two-dimensional shape. You will program with lists and use a loop to plot points on paper.
Design a 2-dimensional shape on paper and in the calculator (Stat Plot).
Have the Rover draw the shape on paper (or simply follow the path).
This project requires the use of two lists that represent the x- and y-coordinates of the vertices of a shape of your own design. In this lesson we will use the design of the block letter T shown to the right. Our goal is to get the Rover to make this design using the marker or just follow the path if no marker is available.
First, set up two lists containing the coordinate pairs. The lists to the right come from the block letter T shown previously. The x-coordinates are in the list L1 and the y-coordinates are in the list L2. If desired, design a different pattern.
Optional: Set up a Stat Plot to display your data in a graph screen to confirm that your data is correct.
Now, we can write a program so that the Rover will draw the shape. Start in the usual manner and, optionally, set the M/UNIT value to a smaller value so that the drawing is not too large. Select prgm > Hub > Rover (RV)... > RV Setup... > Send("SET RV.GRID.M/UNIT.
Remember that 0.01 makes the unit 1 cm. If you want the unit to be 1 inch, use 0.0254. Add the closing quotation mark and closing parenthesis.
We use a For( loop to process each element of the two lists. Remember that For( requires three arguments, the loop control variable, I, a starting value, 1, and an ending value, dim(L1). Additionally, End is needed at the bottom of the loop body.
Note: dim(L1) is the number of elements in the list L1.
The loop body (the code inside the For( loop) consists of just one statement that tells the Rover to go to each point in the lists in order.
After entering the code, quit and run the program, and see if your shape is drawn correctly.
Overview: Explorations with random numbers can lead to fascinating observations. This application gives you opportunities to explore more probability oddities and to program the Rover to move around on a grid.
A 'random walk' is a computer programming experiment. This activity ties together several different programming skills.
Suppose your town's streets are laid out in a square grid pattern and that your school is located at (0,0) on the grid. Your home is at (7,3), which represents 7 blocks east and 3 blocks north of the school. (Consider changes to this position.) The image to the right is a Stat Plot of these two points.
Starting at the school, you walk one block in a random direction (north, south, east, or west). At each intersection you then walk one block in a random direction again. Will you ever make it home? How many blocks will you walk before getting home? Will you quit from exhaustion before you get home?
Planning is an important part of coding. Think about what the Rover can do and what your programming language can do.
Bear in mind that, when working with random numbers, we are at the mercy of the machine. It may take a long time for the Rover to reach home, so we'll add a stipulation that the Rover is allowed only a limited number of blocks before quitting.
Begin this program with the CONNECT.RV statement. Set the Rover's grid size to 5 cm using Send("SET RV.GRID.M/UNIT .05").
Recall that the command is found in prgm > Hub > Rover (RV)... > RV Setup... menu and it changes the Rover's 'unit' of movement (used in FORWARD 1) from 10 cm to 5cm, allowing for more grid points in a smaller space.
Store the home location (7,3) and the starting number of blocks walked (0) in the variables A, B and W, respectively. The variable W will be used to keep track of the number of blocks the Rover walks and will be used to stop the program if the Rover walks too far. The Rover quits from exhaustion when it walks a specified number of blocks.
Let's use 10 blocks walked as a value for the exhaustion distance. Use the variable E for this value: 10→E.
The Rover arrives home when its position, which we refer to as (X, Y), is (7, 3). Initialize both of the variables, X and Y, to be zero.
The main loop of the program consists of a While loop with two conditions to be addressed. The conditions are making it home (when X=A and Y=B) or quitting from exhaustion (when W = E). The Rover quits when the variable W (the number of blocks walked) is equal to the value stored in E.
The While loop continues as long as those conditions are false, so we set up the opposite conditions.
Remember that fixed values related to the problem are stored in E, A, and B.
not( ) is used to ensure that the program continues as long as the Rover is not 'home'. Logically, and not( is the 'opposite' of or.
Remember to include an End statement for the loop.
Increment W (the number of blocks walked): W+1→W.
Turn the Rover to the Angle D: Send("RV TO ANGLE eval(D)").
Move the Rover forward 1 unit (1 block in our simulation): Send("RV FORWARD 1").
Include some Wait commands to keep the program in sync with the Rover's movements. Turning takes time and moving forward takes time. The Wait times depend on the angle of the turn and the distance travelled so you may need to experiment with the Wait values.
If W=E, then the Rover quits walking from exhaustion. Play a sad song, display a red color on the Rover's LED, and display "ROVER QUIT" on the calculator screen.
If X=A and Y=B, the Rover made it home. Play a happy song, display a green color on the LED, and display a "ROVER MADE IT HOME" message on the calculator screen.
Can you get the Rover to do a 'happy dance' when it arrives home?


Meeting with an attorney can help a person determine their best legal recourse for overcoming their debt. A consultation appointment starts the process and gives individuals the information they need so they can make a sound decision for their financial needs. This information seeks to inform individuals of how they can prepare for their meeting with the Bankruptcy Lawyer in Hamilton OH.
The first meeting with the Bankruptcy Lawyer in Hamilton OH can be a little overwhelming for a person. Being prepared helps to ensure the meeting with be a successful one that does not waste time for either party. One of the most important aspects of preparing for this meeting is gathering all of the necessary documents the lawyer will need to see.
Having all of these documents prepared for the meeting will help to prevent needless delays from occurring. The more informed the lawyer is given, the better equipped they will be to help guide their client in making the right choices for their financial needs.
A lawyer can offer a client a couple of bankruptcy options, depending on the client's financial needs. Chapter 7 is the fastest option and is primarily for those with unsecured debts while Chapter 13 takes longer and helps with secured debts such as a mortgage.
Those who are dealing with more debt than their pay allows will find it helpful to schedule a consultation with a bankruptcy lawyer. With the help of a lawyer, the process of overcoming debt through bankruptcy will be much easier. Call the office today to Schedule An Appointment. They will be happy to help you with your debt so you can start anew and be given a second chance.


The New York Trilogy takes you on a wild ride through a detective's world. Paul Auster to me is one of the greatest living writers; he's earned a loyal readership and continues to surprise and delight with each new publication. This is a classic that should be read by everyone, inspiring love for well-written, entertaining, and engrossing detective stories.
Paul Auster is the bestselling author of The New York Trilogy and many other critically acclaimed novels. He was awarded the Prince of Asturias Prize in 2006. His work has been translated into more than forty languages. He lives in Brooklyn, New York.
Luc Sante teaches writing and the history of photography at Bard College. His books include Low Life, Evidence, and The Factory of Facts.


text:
*******************************
IO Processor Architecture
*******************************

.. contents:: Table of Contents
   :depth: 2

Introduction
==================

For overlays to be useful, they must provide sufficient functionality, while also providing flexibility to suit a wide range of applications. Flexibility in the base overlay is demonstrated through the use of IO Processors (IOPs).

An IO Processor is implemented in the programmable logic and connects to and controls an external port on the board. There are two types of IOP: Pmod IOP and Arduino IOP.

Each IOP contains a MicroBlaze processor, a configurable switch, peripherals, and local memory for the MicroBlaze instruction and data memory. The local memory is dual-ported (implemented in Xilinx BRAMs), with one port connected to the MicroBlaze, and the other connected to the ARM® Cortex®-A9 processor. This allows the ARM processor to access the MicroBlaze memory and dynamically write a new program to the MicroBlaze instruction area.

The data area of the memory can be used for communication and data exchanges between the ARM processor and the IOP(s). E.g. a simple mailbox.

The IOP also has an interface to DDR memory. This allows the DDR to be used as data memory in addition to the local memory. This allows larger applications to be written (where data memory is the limitation) and allows a larger mailbox size for data transfer between the PS (Python) and the IOP. The DDR interface also allows different IOPs to communicate with each other directly without intervention from the PS (Python).

In the base overlay, two IOPs control each of the two Pmod interfaces, and another IOP controls the Arduino interface. Inside the IOP are dedicated peripherals; timers, UART, IIC, SPI, GPIO, and a configurable switch. (Not all peripherals are available in the Pmod IOP.)

IIC and SPI are standard interfaces used by many of the available Pmod, Grove and other peripherals. GPIO can be used to connect to custom interfaces or used as simple inputs and outputs.

When a Pmod, Arduino shield, or other peripheral is plugged in to a port, the configurable switch allows the signals to be routed dynamically to the required dedicated interface. This is how the IOP provides flexibility and allows peripherals with different pin connections and protocols to be used on the same port.

Pmod IOP
==================

Two Pmod IOPs are included in the base overlay to control each of the two Pmod interfaces on the board.

.. image:: ./images/pmod_iop.jpg
   :align: center

As indicated in the diagram, the Pmod IOP has a MicroBlaze, a configurable switch, and the following peripherals:

* `AXI Timer <http://www.xilinx.com/support/documentation/ip_documentation/axi_timer/v2_0/pg079-axi-timer.pdf>`_
* `AXI IIC <http://www.xilinx.com/support/documentation/ip_documentation/axi_iic/v2_0/pg090-axi-iic.pdf>`_
* `AXI SPI <http://www.xilinx.com/support/documentation/ip_documentation/axi_quad_spi/v3_2/pg153-axi-quad-spi.pdf>`_
* `AXI GPIO <http://www.xilinx.com/support/documentation/ip_documentation/axi_gpio/v2_0/pg144-axi-gpio.pdf>`_

Pmod IOP peripherals
------------------------

I2C
^^^^^^^^^^^^^^^^^^^

The I2C configuration is:
   * Frequency: 100KHz
   * Address mode: 7 bit

SPI
^^^^^^^^^^^^^^^^^^^

The SPI configuration is:
   * Standard mode
   * Transaction width: 8
   * Frequency: 6.25 MHz (100MHz/16)
   * Master mode
   * Fifo depth: 16

GPIO blocks
^^^^^^^^^^^^^^^^^^^

The GPIO block supports 8 input or output pins

Timer
^^^^^^^^^^^^^^^^^^^

The timer is 32 bits width, and has a *Generate* output, and a PWM output. The *Generate* signal can output one-time or periodic signal based on a loaded value. For example, on loading a value, the timer can count up or down. Once the counter expires (on a carry) a signal can be generated. The timer can stop, or automatically reload.

Interrupt controller
^^^^^^^^^^^^^^^^^^^^^^^^^^

The I2c, SPI, GPIO and Timer are connected to the interrupt controller. This is the standard MicroBlaze interrupt controller, and interrupts can be managed by the IOP in a similar way to any other MicroBlaze application.

Pmod IOP configurable switch
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The configurable switch can route signals from the internal IP to the external FPGA pins. The switch is controlled by the MicroBlaze, and can be configured from an IOP application.

For details on using the switch, see the next sections on *IO Processors: Writing your own software* and *IO Processors: Using peripherals in your applications*.

Arduino IOP
===========================

Similar to the Pmod IOP, an Arduino IOP is available to control the Arduino interface. The Arduino IOP is similar to the PMOD IOP, but has some additional internal peripherals (extra timers, an extra I2c, and SPI, a UART, and an XADC). The configurable switch is also different to the Pmod switch.

.. image:: ./images/arduino_iop.jpg
   :align: center

As indicated in the diagram, the Arduino IOP has a MicroBlaze, a configurable switch, and the following peripherals:

* 6x `AXI Timer <http://www.xilinx.com/support/documentation/ip_documentation/axi_timer/v2_0/pg079-axi-timer.pdf>`_
* 2x `AXI IIC <http://www.xilinx.com/support/documentation/ip_documentation/axi_iic/v2_0/pg090-axi-iic.pdf>`_
* 2x `AXI SPI <http://www.xilinx.com/support/documentation/ip_documentation/axi_quad_spi/v3_2/pg153-axi-quad-spi.pdf>`_
* 3x `AXI GPIO <http://www.xilinx.com/support/documentation/ip_documentation/axi_gpio/v2_0/pg144-axi-gpio.pdf>`_
* 1x `AXI UART <https://www.xilinx.com/support/documentation/ip_documentation/axi_uartlite/v2_0/pg142-axi-uartlite.pdf>`_
* 1x `AXI Interrupt controller <https://www.xilinx.com/support/documentation/ip_documentation/axi_intc/v4_1/pg099-axi-intc.pdf>`_
* 1x `AXI XADC <https://www.xilinx.com/support/documentation/ip_documentation/axi_xadc/v1_00_a/pg019_axi_xadc.pdf>`_

Arduino IOP peripherals
------------------------

The I2C, SPI, GPIO and Timer blocks are the same as the Pmod IOP blocks. The only difference in the Arduino IOP with these blocks is that for the IIC and SPI, 2 interfaces are enabled, for the GPIO 3 blocks are include, and 6 timers.

I2C
^^^^^^^^^^^^^^^^^^^
Two I2C available.

SPI
^^^^^^^^^^^^^^^^^^^

Two SPI available. One is always connected to the Arduino interface dedicated SPI pins.

GPIO blocks
^^^^^^^^^^^^^^^^^^^

There are three GPIO block available. They support 16 input or output pins on the Arduino interface (D0 - D15).

Timers
^^^^^^^^^^^^^^^^^^^

There are six timers available.

UART
^^^^^^^^^^^^^^^^^^^^^^^

There is a UART controller, with a fixed configuration of 9600 baud. The UART can be connected to the Arduino UART pins. The UART configuration is hard coded, and is part of the overlay. It is not possible to modify the UART configuration in software.

Interrupt controller
^^^^^^^^^^^^^^^^^^^^^^^

The interrupt controller can be connected to all the analog and digital pins, and each of the 6 timers, the I2Cs, the SPIs, the XADC, and UART. This means an external pin on the shield interface can trigger an interrupt. An internal peripheral can also trigger an interrupt.

Arduino shields have fixed possible configurations.  According to the Arduino specification, the analog pins can be used as analog, or digital I/O.

Other peripherals can be connected as indicated in the table.

==========   =========================
Peripheral   Pins
==========   =========================
UART         D0, D1
I2C          A4, A5
SPI*         D10 - D13
PWM          D3, D5, D6, D9, D10, D11
Timer        D3 - D6 and D8 - D11
==========   =========================

\* There are also dedicated pins for a separate SPI.

For example, a shield with a UART and 5 Digital IO can connect the UART to pins D0, D1, and the Digital IO can be connected to pins D2 - D6.

While there is support for analog inputs via the internal XADC, this only allows inputs of 0-1V. The Arduino interface supports 0-5V analog inputs which is not supported on the PYNQ-Z1.

Arduino IOP configurable Switch
---------------------------------

The switch is controlled by the MicroBlaze, and can be configured by writing to its configuration registers from an IOP application.

The dedicated SPI pins that are part of the Arduino interface are always connected to one of the SPI controllers.

The analog and digital pins can be configured by writing a 4-bit value to the corresponding place in the IO switch configuration registers, similar to the Pmod switch.

For details on using the switch, see the next sections on *IO Processors: Writing your own software* and *IO Processors: Using peripherals in your applications*.

redpajama_set_name: RedPajamaGithub


South London Liberal Synagogue provides activities and education for children from birth to 15 years of age. This includes studying for Bar/Bat Mitzvah and Kabbalat Torah. Many of our young people decide to become assistants after their Kabbalat Torah, sharing their enthusiasm and knowledge with Gesher's children.
Gesher, our lively Religion School, meets weekly and welcomes children where either parent is Jewish, and encourages all family members to become involved. Our curriculum is designed to help our children develop a pride in being Jewish and provides them with the ability to apply Jewish values in the modern world. Children spend half the morning learning Hebrew and half exploring Jewish life, festivals, values and history. Our Hebrew curriculum is taught through various activities, including art, games and music. Our children also take part in regular Family Services with their parents, using a Siddur they illustrated themselves. To enrol your children in Gesher, or simply to find out more, please contact the synagogue office.
Our Toddler group runs once a month during term time. Activities are often festival based, and parents are welcome to stay. Please contact the synagogue office for further details.
Please contact the synagogue office for details of services, events and information about membership of the synagogue.