motors1 example: read_trimpot == analogRead?

The motors1 example includes the following snippet:

// note that the following line could also be accomplished with:
// int pot = analogRead(7);
int pot = read_trimpot();

Which I believe is incorrect in two ways:

  1. analogRead’s an Arduino/Wiring thing, no? I can’t find it in pololu/orangutan.h
  2. the doc for read_trimpot ( notes that it uses analog_read_average() to average 20 samples, which analogRead doesn’t do


Hello, Ben.

The comment should say “analog_read” instead of “analogRead”. Thanks for pointing that out. I don’t think the comment is claiming that both lines are equivalent; it is just saying that these are two different ways of reading the potentiometer. Most users probably do not need the pot readings to be averaged.